Let's head back to antiquity with a mad emperor, Justin II. He ruled from 565 to 578 and became emperor under somewhat suspect circumstances. His uncle Justinian I passed away and his chamberlain Callinicus claimed that Justinian designated Justin II as his successor on his deathbed. Callinicus wanted to be political allies with Justin, so he may have fabricated the story.
At first, Justin II seemed to have the empire's best interests in mind -- he took care of the financial end and was tolerant of a minority group of Christians (although he later persecuted them). Then he decided to stop paying other countries around the empire to keep the peace, and his decision led to the loss of part of Italy as well as war with Persia [sources: Encyclopedia Britannica, Evans].
Perhaps these failures triggered his mental illness? Regardless, by 574 his wife was acting on his behalf. She convinced him to make a general in his army, Tiberius, his adopted son and heir. Justin II remained emperor in name only until his death, with Empress Sophia and Tiberius ruling as co-regents. Those last few years of his life were terrible. He tried to throw himself out of the windows of his palace, screamed, howled, babbled and bit his chamberlains. Stories circulated that Justin had actually eaten two of them. To soothe him, servants wheeled him around on a wagon for hours while organ music played [sources: Evans, John of Ephesus].