When dealing with cases involving the death penalty in Israel at the time of the Old Testament, at least two witnesses had to be summoned to court (Numbers 35: 30). If these accused the defendant using false testimony, he was, given the corresponding verdict, executed despite his innocence (1 Kings 21).
If, however, the court found that a witness had given false testimony, then this witness would receive the punishment which the defendant would have received if he had been found guilty (Deuteronomy 19: 18-19).
In Jewish wisdom literature, bearing false witness is associated with lying in general: "A false witness will not go unpunished, and he who speaks lies shall perish" (Proverbs 19: 9).