Deuteronomy 25:2-3
25:2 Then, if the guilty person is sentenced to a beating, the judge shall force him to lie down and be beaten in his presence with the number of blows his wicked behavior deserves.
25:3 The judge may sentence him to forty blows, but no more. If he is struck with more than these, you might view your fellow Israelite with contempt.
Ezra 7:26
7:26 Everyone who does not observe both the law of your God and the law of the king will be completely liable to the appropriate penalty, whether it is death or banishment or confiscation of property or detainment in prison.”