Azmael

Azmael (also spelt Azmeal) was a mentor of the Doctor who emigrated from Gallifrey to the planet Jaconda, where he ruled compassionately until Mestor deposed him. (TV: The Twin Dilemma) By one account, he was the first High Chancellor and first true renegade Time Lord. (PROSE: The Legacy of Gallifrey)

Childhood
Like all Time Lords, Azmael was taken from his family at the age of eight for the selection process in the Drylands. Staring into the Untempered Schism as part of a Time Lord initiation rite, Azmael reacted by running away from what he saw in the Schism. (PROSE: A Brief History of Time Lords)

Chancellorship & being Rassilon's ally
According to Postar the Perfidious's Scrolls of Gallifrey, after Rassilon's abdication Azmael became Chancellor to the new Lord President, Pandad, in the newly-restructured government. The increasingly-secretive Rassilon took Azmeal into his confidence about the position of the Great Key to the Eye of Harmony, also decreeing that to make sure no Time Lord would ever both be in charge of Gallifrey's government and in power over the Eye, Azmeal could never be allowed to ascend to the rank of President, nor any other Chancellor after him.

Azmeal gained Rassilon's trust to such an extent that when the Founder discovered the twelve-regeneration limit when fruitlessly attempting his thirteenth regeneration, it was Azmeal whose help he enlisted to help with his last shot at immortality; Azmeal worked the machines as Rassilon's mind was the first full Gallifreyan intelligence to be uploaded into the Matrix.

However, following the Civil War between Pandad's Gallifrey and the rival presidency of Morbius, it was decreed that the Lord President and High Chancellor needed to belong to the same Chapter to minimise friction. As Pandad's successor Helron was an Arcalian, Azmeal was put "out of a job". (PROSE: The Legacy of Gallifrey)

Mentoring the Doctor
Azmeal was not too displeased to lose his political position, as it freed his schedule to study the secrets of the Matrix which Rassilon had just barely begun to show him upon his death. (PROSE: The Legacy of Gallifrey) He mentored the First Doctor at the Prydonian Academy, (PROSE: Divided Loyalties) and they both held a great respect for one another. Azmael was present when the Doctor was expelled from the Academy and was Coordinator at this time. (PROSE: Divided Loyalties)

By one account, Azmael mentored the young Doctor (TV: The Twin Dilemma) while meditating under a tree on the mountain behind the Doctor's childhood house. (TV: The Time Monster, State of Decay, et al.)

Meanwhile, in his studies, Azmeal progressively discovered hints that the minds of the dead Time Lords were not static records of memories, but rather active as disembodied intelligences still guiding things from the shadows with Rassilon as their leader. Azmeal's growing influence over the Matrix, which they still did not understand themselves, led to Helron and his government planning to remove Helron from Gallifrey in his final incarnation, in forced retirement, as a way to stop him from studying it further. (PROSE: The Legacy of Gallifrey) This was an offer which Professor Chronotis was the only Time Lord ever to actually accept. (PROSE: Shada)

Leaving Gallifrey
According to the Scrolls of Gallifrey, Azmeal left Gallifrey to escape Helron's goons and continue his experiments. (PROSE: The Legacy of Gallifrey) By another account, he left for Vitrol Minor because he was tired of his life and wanted to make a fortune. Knowing that his knowledge and experience could be used against the Time Lords by their enemies, the High Council found him guilty of various fabricated charges in his absence and condemned him to death, (PROSE: The Twin Dilemma) with Helron sending a warrior race (PROSE: The Legacy of Gallifrey) of Seedle Warriors to execute him.

On Vitrol Minor the Seedle Warriors committed genocide, (PROSE: The Twin Dilemma) destroying the planet and its inhabitants to bring Azmeal back to Gallifrey for his trial. (PROSE: The Legacy of Gallifrey) Azmael began his own legal proceedings against the Lord President and High Council in response; however, they bought witnesses and accused him of hiring the Seedle Warriors himself in a bid to gain exclusive rights to Vitrol Minor's minerals. Angered, Azmael shot down the High Council with a laser rifle, (PROSE: The Twin Dilemma) becoming the first official renegade Time Lord. (PROSE: The Legacy of Gallifrey)

Disgusted with what he had done, Azmael left his homeworld once more. (PROSE: The Twin Dilemma) The next High Council cautiously allowed him to make his escape. (PROSE: The Legacy of Gallifrey)

As the first of many renegade Time Lords to formally renounce the values and laws of Gallifrey, Azmeal became an inspiration to a whole generation of young Time Lords at the Academy, including the Doctor, the Master, and the Rani, who deemed that Rassilon had been right to pronounce Time Lord society decadent upon his deathbed and that a change must be undergone. In turn, each of the three left Gallifrey, (PROSE: The Legacy of Gallifrey) as did others of their classmates, such as Drax and the Monk. (PROSE: Divided Loyalties)

On Jaconda
Azmael travelled for several years, earmarking Titan III in Maston Viva as a place to escape to should Seedle Warriors be sent after him once more, before settling on Jaconda where he was elected as their leader. Months after his election, the Gastropods attacked. To save the Jacondans, Azmael surrendered to Mestor. (PROSE: The Twin Dilemma)

Mester used a telepathic link with Azmael to dominate his mind. Mestor forced Azmael, who used the name Professor Bernard Edgeworth, (PROSE: The Twin Dilemma) to kidnap the two young genius identical twins Romulus and Remus Sylvest. By this time, Azmael had reached the end of his regeneration cycle.

Recently regenerated himself, the Sixth Doctor and Peri came to Titan III. There they saw the wreckage of a ship and rescued Lieutenant Hugo Lang. While exploring some tunnels on the asteroid, Peri and the Doctor were captured and taken to meet Azmael. Co-operating with Mestor to save his people, Azmael abandoned the Doctor and Peri, letting them be taken captive. However, when the Doctor and Peri were able to follow him to Jaconda. (TV: The Twin Dilemma)

Death
After being attacked by the Doctor due to post regeneration trauma, Azmael sided with the Doctor when his observations revealed Mestor's true plan to trigger a solar eruption that would destroy Jaconda and send Mestor's eggs out across the universe. When Mestor took possession of Azmael's body and the Doctor destroyed Mestor's real body, Azmael, with Mestor's consciousness within him, forced himself to die by attempting to regenerate. Since Azmael had already used all twelve of his regenerations, initiating a thirteenth regeneration resulted in both his and Mestor's deaths, which Mestor was unprepared for. (TV: The Twin Dilemma)

Undated events
At some point during the Doctor's fourth incarnation, Azmael and the Doctor had an encounter in which Azmael drank so much alcohol that the Doctor had to throw him into a fountain to sober him up. (TV: The Twin Dilemma) As the Doctor lacked money, Azmael had to pay. (PROSE: The Twin Dilemma)

Appearance
In his thirteenth incarnation, Azmael was an elderly man with a shiny bald head, looking like Father Christmas without a beard. He wore a long brown smock. (PROSE: The Twin Dilemma)

Behind the scenes

 * Azmael debuted in The Twin Dilemma in 1984. The following years, the short story The Legacy of Gallifrey and the novelisation The Twin Dilemma independently adapted his backstory from that episode. These sources differ in several aspects, such as Azmael's motivation for leaving Gallifrey and the spelling of his name. These discrepancies may be explained by the attribution of The Legacy of Gallifrey to the writings of "Postar the Perfidious", although such a link has never been drawn in an in-universe source.
 * Per the advice of Ian Levine, Azmael was written to be the Doctor's mentor mentioned in The Time Monster and State of Decay. However, Anthony Steven misunderstood and did not realise that this mentor had already appeared in Planet of the Spiders as K'anpo Rimpoche. To solve the discrepancy, Divided Loyalties reinterpreted Azmael as the Doctor's tutor at the Prydonian Academy.
 * Harry Andrews, Bernard Archard, Geoffrey Bayldon, and Peter Cushing were considered for the role before Maurice Denham was cast.