Deuteronomy 19:18

And the judges shall make diligent inquisition: and, behold, if the witness be a false witness, and hath testified falsely against his brother;

Deuteronomy 19:18 belongs to Moses's review of the law for the new generation given just before his death, forming part of the second of the three addresses that make up Deuteronomy in chapters 5 to 26, the section from which the book is named Deuteronomy meaning the second law or duplicate of the law. It requires the judges to make diligent investigation to determine whether a witness has testified falsely against another person, carefully examining the accusation and the charge brought forward.

In its legal setting a matter is established by two or three witnesses, not by one alone. The witnesses must agree in their testimony. If investigation proves the witness false and exposes the testimony as false, the false witness must receive the punishment he intended for the accused, including the punishment that would have fallen on the accused if convicted, so that false testimony is subject to the penalty prescribed for the harm it sought to bring about. This safeguard helped protect people's lives against false testimony. This rule also guards a person's property and reputation against false testimony.