For the source text click/tap here: Sanhedrin 19
To download, click/tap here: PDF
The Gemara on our daf clarifies that the limitation on being judged does not apply to Jewish kings from the Davidic monarchy; it only applies to other kings. The fact that kings from King David’s family do judge is based on a clear passage in Sefer Yirmiyahu (21:12) that charges those kings with meting out justice and protecting the oppressed in the courtroom.
The Gemara relates further that the law limiting a Jewish king who is not from the House of King David from being judged or acting as a judge is based on a story that took place with King Yannai.
We examine the literary production of this legend from its textual forebears in Midrash and Josephus.