Empress Kōken (born Abe, known as Empress Shōtoku during her second reign; 718–770) was the 46th and 48th monarch of Japan according to the traditional order of succession. Seeking to protect the bloodline of Prince Kusakabe, her father, Emperor Shōmu, named her as his heir in 738, and she succeeded her father as empress regnant in 749 after he retired to become a Buddhist monk. With the backing of her mother, Empress Kōmyō, and cousin Fujiwara no Nakamaro, she was able to outmaneuver a largely hostile (Council of State). Her father died in 756, having named a cousin unrelated to the Fujiwara clan as Kōken's heir; this outraged her maternal Fujiwara relatives and their supporters, and Kōken replaced him with Prince Ōi, a close ally of her mother and Nakamaro. In 757, she headed off a conspiracy to overthrow her by Tachibana no Naramaro, and resigned the following year to serve as empress emerita (), while Ōi reigned as Emperor Junnin.

Nakamaro slowly consolidated his political power with the backing of Empress Kōmyō. After an illness, Kōken became close to a healer-monk named Dōkyō, who became one of her strongest allies, as well as potentially an intimate partner. After this, she became a bhikkhunī (Buddhist nun) and shaved her head. After her mother's death in 760, Kōken began to oppose Nakamaro. She proclaimed superiority over Emperor Junnin in state matters in 762, and allied with anti-Nakamaro leaders, including her childhood tutor Kibi no Makibi. In 764, political conflict grew violent after she attempted to take control of the imperial seals; Nakamaro fought a brief rebellion against her, naming Prince Shioyaki as emperor, but both were captured and executed, and Kōken returned to the throne as Empress Shōtoku.

Shōtoku's second reign was marked by the promotion of Buddhist ideals and religious institutions, as well as the advancement of Dōkyō (who was promoted to the rank of , 'Prince of the Law' or 'Buddhist King') to oversee religious matters. She oversaw land reform which placed limits on land ownership for all except Buddhist temples—alienating aristocrats and courtisans, and ordered the foundation of a new capital. As part of her religious reforms, she placed monastic officials on the Council of State for the first time, and ordered the construction of one million miniature pagodas housing printed prayers; these were distributed to major temples around Nara. In 769, she was the subject of an incident where an oracle of the Usa Shrine stated that the deity Hachiman sought for Dōkyō to become emperor. This was disputed by an emissary named Wake no Kiyomaro, and Dōkyō lost his political standing following her death several months later.

Early life and background Princess Abe was born in 718 to Obito, the heir to the Japanese throne, and his consort Fujiwara Asukabehime. Obito, the son of Emperor Monmu and grandson of the powerful statesman Fujiwara no Fuhito, had been considered as a candidate for emperor in his youth after his father's death in 707. Instead, Monmu's mother Gemmei was selected; this was somewhat supported by Obito's proponents, as Gemmei wished for Obito to be her successor. Obito was named heir in 713, but did not succeed his grandmother when she resigned in 715. Instead, the throne first passed to Obito's aunt Genshō, who passed the throne to Obito in 724. Obito then reigned as Emperor Shōmu.

Emperor Shōmu and Asukabehime had a son, Motoi, in 727. To the frustration of some court members, the Emperor designated Motoi his heir soon after his birth, following the succession law promulgated in the Taihō Code. However, Motoi died before the age of two, leaving the future succession unclear. Shōmu had another son, Prince Asaka (born to a mother from the Agata-Inukai family) whose potential succession greatly worried the Fujiwara clan and its supporters. Following the alleged coup attempt and resulting suicide of the potential throne claimant Prince Nagaya in 729, Shōmu appointed Asukabehime as empress. Taking the title Empress Kōmyō, this appointment qualified her to become empress regent upon Shōmu's death, and privileged her descendants (including Abe) for future succession.

Heir apparent The 735–737 Japanese smallpox epidemic devastated western Yamato, killing all four of Empress Kōmyō's brothers. Although the court was reorganized in the aftermath of the epidemic (with significantly less Fujiwara influence), Shōmu declared his twenty-one-year-old daughter Abe his heir in 738. A woman had never been declared as heir to the throne; prior empresses, such as Genmei and Genshō, had only reigned temporarily during the minority of male heirs. Non-Fujiwara members of the court opposed Abe's heirship in favor of Asaka, but Shōmu resisted, seeing Asaka's Agata no Inukai mother's clan as less useful allies than those of Abe's Fujiwara mother. Asaka died in 744 at age 16, leaving Abe as the only plausible heir.

Writing in a later edict, Abe recounted how her "mother revealed that the royal stem line [of Prince Kusakabe] would end. To prevent that, it was necessary that I succeed, even though a woman."

Abe was educated by the scholar Kibi no Makibi, who had studied in China and taught her to read the Chinese classics such as the Book of Rites and the Book of Han. Likely at Kibi's suggestion, she performed the dance for Emperor Shōmu and Genshō in a filial ceremony in the early spring of 743. Abe never married or had children; this may have been to preserve the bloodline of Prince Kusakabe, as any of her children would be considered part of her consort's family and not a direct descendant of Kusakabe.

Genshō died in 748, leaving the office of vacant. Shōmu, purportedly in ill health and unable to fulfill his duties as emperor, issued an edict in 749, declaring, "Reflecting upon the fact that only sons carry on the father's name, should daughters go unrewarded? It is fitting that both serve together." On the second day of the seventh month of 749, Shōmu resigned to become a Buddhist monk, and Abe took the throne as Empress Kōken. Shōmu's resignation speech appealed to concepts of sacred kingship and patrilineal succession, followed since the reign of Emperor Tenji, as well as to female deities and past female rulers.

First reign At the beginning of her reign, Empress Kōken faced considerable political opposition from the . Only three members of the fifteen-member council were members of the Fujiwara clan. She chose a four-character era name, , upon her ascension to the throne, possibly modelled after the unique four-character era names introduced by the influential Chinese empress regnant Wu Zetian.

As her lack of an heir proved a consistent source of political tension with the Grand Council of State, Kōken sought to rule by decree and bypass the council. Her mother, Empress Kōmyō, transformed the ('Empress-consort's Household Agency') into a larger agency dubbed the . Taking on a dual role as both a secretariat and a managing agency for the imperial household, the agency expanded to include around a thousand officials and performed duties similar to those of the Council of State. Kōmyō appointed her nephew, Fujiwara no Nakamaro (the grandson of Fujiwara no Fuhito and a member of the Great Council of State), to head the agency. He used it to transmit and enforce Kōken's edicts. This agency granted tremendous power to both Kōmyō and Nakamaro, the latter of whom steadily gained influence over the course of Kōken's reign, becoming the dominant political figure in Kōken's court and representing a resurgence of Fujiwara power. Nakamaro suppressed the influence of Kōken's opponents, including his main political rival, Tachibana no Moroe—the nominal head of government, formerly supported by Empress Genshō.

Kōken and Nakamaro also used the Tōdai-ji Construction Agency (), established by Shōmu to oversee the creation of the Nara Great Buddha, as a means to support their rule. The Great Buddha was completed in 752 and inaugurated in a grand ceremony in the fourth month; the monk Bodhisena painted the statue's eyes before the Empress, her parents, and a great number of monks. They installed a plaque declaring the temple the "Realm-protecting temple of the golden light and the four heavenly kings", the chief temple of the emerging state temple system. That year, monastic governors were dispatched to each province to supplement the secular Ritsuryō and manage the temple in each.

Emperor Shōmu died in the fifth month of 756, and his will assigned a cousin, Prince Funado (one of Emperor Tenmu's grandsons), to become Kōken's heir. Funado was not related to the Fujiwara, outraging their supporters, while the declaration of an heir by someone other than the sovereign themselves was seen as highly unusual. Several days later, Fujiwara officials retaliated by arresting two prominent opponent officials accused of disrespecting the Empress. Kōken disavowed Funado as heir in an edict issued in the fourth month of 757, accusing him of failing to observe the mourning period for Shōmu. This edict also ordered copies of the Confucian Classic of Filial Piety to be distributed to local chieftains, likely echoing Emperor Xuanzong of Tang, who, fourteen years earlier, had ordered his commentary on the classic to be distributed. Later that year, Kōken appointed Nakamaro's son-in-law, Prince Ōi, another of Tenmu's grandsons and a close ally of both Nakamaro and Kōmyō, as heir to the throne. He would eventually reign as Emperor Junnin.

Naramaro conspiracy and resignation According to the (one of the Rikkokushi "Six National Histories"), Tachibana no Naramaro, the son of Moroe, attempted to organize a coup d'état against Kōken, Kōmyō, and Nakamaro in the seventh month of 757, heading a conspiracy involving over four hundred officials and four princes. They allegedly sought to kill Nakamaro and to overthrow the Empress, installing one of their own as emperor. Upon learning of Naramaro's plans, Kōken and Kōmyō ordered imperial guard units to crack down on the plotters. The punishment inflicted on the plotters varied: some of them were executed, including Funado (whose name was officially changed to Matohi, 'foolish', before his death). Some princes were reduced to the status of commoners before their executions. Some plotters were exiled or imprisoned until later amnesties released them, while others were pardoned immediately. The fate of Naramaro himself is unknown, but his family avoided the extermination prescribed for the families of those convicted of high treason.

In the eighth month of the same year, a commoner from Suruga Province is said to have presented the imperial court with a cocoon on which sixteen characters had been woven by a silkworm. This miraculous sign prompted the issuance of an edict five days later, proclaiming the beginning of a new era, . Later in 757, the government promulgated the Yōrō Code, a legal code first begun by Fujiwara no Fuhito prior to 720. The following year, Nakamaro founded frontier outposts in the remote northern provinces of Mutsu and Dewa and ordered the construction of a fleet of 500 ships for a planned invasion of the Korean kingdom of Silla.

Later in 758, Kōken took control of the Imperial Guards from Nakamaro, but was pressured to resign in order to pass the throne to Ōi, who took the throne as Emperor Junnin. Kōken, now , also became known by the name Kōya.

Interregnum Unusually for a new emperor, Junnin's accession to the throne was not accompanied by a new era name. At the outset of his reign, he presided over the imperial court alongside Kōken and Kōmyō. Nakamaro's power grew under Junnin's reign; he became the leader of the Council of State, seeing an appointment both as the Minister of the Right and as the , 'Grand Protector'. Junnin was largely under Kōmyō and Nakamaro's political influence; soon after taking office, Junnin granted Nakamaro land and a new name, Emi no Oshikatsu.