Koro-sensei Quest!
It's Not a Job, It's a Calling (1x11)
:
When Koro-sensei was a human, he was thought of as a hero, but became bored of his work. He was assigned by Aguri Yukimura to be a Demon King and live in a castle, since his predecessor (actually Neuro from Neuro: Supernatural Detective) retired from his position.