When Dōkyō cured the illness of Kōken in 761, after she had abdicated in 758, he attained a secure and influential place in her court; she initially regarded him as her healer and spiritual adviser, before turning to him for political advice as well. According to some accounts, he also became her lover. When Junnin attempted to remonstrate with her over this latter issue, she rebuffed him and granted Dōkyō greater powers and authority. She appointed him "shōsōzu" in 763, an important position in the Buddhist hierarchy. Fujiwara no Nakamaro, a favourite of the Emperor Junnin, was angered by this decision, but failed in his attempt to oppose Dōkyō - he was exiled. When Kōken returned to the throne as Empress Shōtoku following Fujiwara no Nakamaro's unsuccessful rebellion, Dōkyō was made daijō-daijin within a year, giving him authority over both civil and religious affairs.