According to Wikipedia:
The phrase is likely to have originated in the Kingdom of Israel following the Law of Moses in beth din courts as a way of giving credence to the authority of God as the author of all law. It is likely to have come from Deuteronomy 16:18 where it stated: “Judges and officers shalt thou make thee in all thy gates, which the Lord thy God giveth thee, tribe by tribe; and they shall judge the people with righteous judgment”. This gave rise to the theory that judges had been given authority from God to exercise judgment on matters of the law and would use the phrase to attribute this fact to God. The phrase continued to be used in courts, passing from Jewish to Christian context as a way to continue to affirm God as the highest authority in law.
But none of the sources give an original Jewish source, so are they mistaken and it’s actually a Christian invention?