Abu Hurairah narrated that the Messenger of Allah (ﷺ) said:
"Whoever takes the responsibility of judge, or is appointed as judge between the people, then he has been slaughtered without a knife."