The Fujiwara no Nakamaro Rebellion (藤原仲麻呂の乱, fujiwara no nakamaro no ran), also known as the Emi Rebellion, was a short-lived and unsuccessful Nara period military confrontation in Japan resulting from a power struggle between former Empress Kōken and the main political figure of the time, Fujiwara no Nakamaro from the powerful Fujiwara clan.
 Through the support of Emperor Shōmu and Empress Kōmyō, with whom he had family-ties, Nakamaro rapidly climbed the career ladder during the 740s and 750s achieving some of the highest ranks and court positions. During the early years of the reign of Emperor Junnin, whom he supported, Nakamaro ruled the country de facto. Following the death of Kōmyō in 760, the retired Empress Kōken started to take government affairs into her hand resulting in a conflict between Nakamaro/Junnin on one side and Kōken and her close associate Dōkyō on the other.
 In order to restore authority, on the 11th day of the 9th month, Tenpyō-hōji 8  (October 14, 764), Nakamaro seized the signs of imperial authority and left the capital at Nara for the Eastern Provinces. The group around Kōken reacted by mobilizing an army and blocking access on the main roads. The two armies eventually engaged in a battle a week later on the 18th day of the 9th month (October 21, 764) at Miozaki on the western side of Lake Biwa in which Nakamaro was killed, ending the rebellion.
 Fujiwara no Nakamaro was a Japanese aristocrat (kuge) and the second son of Fujiwara no Muchimaro, founder of the nanke (southern) branch of the Fujiwara clan. He lived during the Nara period, when the Fujiwara were struggling with the Tachibana clan for influence at the court. Under Emperor Shōmu, who ruled from 724 through 749, the Tachibana were ahead and the influential position of "Minister of the Left" (sadaijin) was held by Tachibana no Moroe. Fujiwara no Nakamaro made his first contact with the military in 740 as "Great General of the Forward Cavalry" for the escort of Emperor Shōmu's tour to the eastern provinces during the Fujiwara no Hirotsugu rebellion.
 In 743, he was appointed as consultant. Shortly thereafter, when the capital was moved from Kuni near the Tachibana power base to the Shigaraki Palace, near Fujiwara holdings, Nakamaro, backed by his aunt Empress Kōmyō joined the Council of State (Daijō-kan). As head of the Office of Empress Consort (shibi chudai), he was in charge of Kōmyō's principal affairs and his political influence increased as laws issued by the office carried the same weight as imperial edicts. At the same time the power of Tachibana no Moroe, who had been backed by retired Empress Genshō until her death in 748, was in decline. Through this favoritism Nakamaro rose quickly in court rank from 4th senior lower (744) through 4th senior upper (746), 3rd junior (748), 3rd senior (749) and 2nd junior rank in 750.
 Shōmu abdicated in 749 in favour of his daughter, Princess Takano-hime, then Empress Kōken. While being an independent and strong-willed woman who identified herself with the Chinese autocratic Empress Wu, during her first reign until 758 she would still be under the shadows of her father, retired Emperor Shōmu and Kōmyō. She would favour the Fujiwara and particularly Nakamaro, giving him much revenue and power by bestowing on him titles. When Moroe publicly criticized Kōken at a drinking party in 755, Nakamaro and his followers forced him to retire. Nakamaro's rapid rise through favoritism was seen with envy, even among the Fujiwara clan members and particularly by his brother Toyonari.
 Following Moroe's death in 757, his son, Tachibana no Naramaro plotted to remove Fujiwara no Nakamaro and to overthrow Empress Kōken (Tachibana no Naramaro Conspiracy). But Nakamaro learned about it and had the main conspirators executed and his own brother Toyonari send to exile in Dazaifu. In the same year, Nakamaro was appointed to "Minister of Right" (Udaijin) and "Minister of Office of Empress Consort" (shibi naishō) which oversaw military affairs of the country. Other positions he held during this time included "Vice Minister" (jundaijin) and "Senior Commander of the Middle Bodyguards".
 In 758, Kōken abdicated formally in favour of Emperor Junnin, a Nakamaro puppet, married to Nakamaro's daughter. The title of the Minister of Right, held by Nakamaro at the time, was changed to taihō (Grand Guardian) and his name changed to Emi no Oshikatsu. Nakamaro, at the peak of his power, went north to subdue the Ezo people and made plans to conquer the Korean kingdom of Silla. On the 11th day of the 1st month, 760, Nakamaro was promoted from taihō to taishi and received the 1st junior rank; and in 762 the 1st senior rank.
 Nakamaro's authority started to decline when his main supporter, Kōmyō, died in 760 and Kōken started to play a more active role in politics. She would allow reigning Emperor Junnin, who was supported by Nakamaro, to do only ceremonial and minor tasks, while she would handle all important governing issues including gratifications and punishments. This is expressed in an edict issued by Kōken in the 6th month of 762 stating: "henceforth the emperor will conduct minor affairs of state, but important matters of state, including the dispensation of awards and punishments, will be handled by me. Famines, epidemics and expenses for the planned invasion of Silla and a new palace at Hora added to the burden on the government. Furthermore Kōken had developed an intimate relationship  with the Buddhist monk, Dōkyō, who had healed her of some illness in the 4th month of 762. In the following year, the appointment of Dōkyō to the third rank in the ecclesiastical hierarchy (Shōsozu) meant the displacement of Jikun, a priest close to Nakamaro.
 Worried about governmental power moving to Dōkyō and seeing fellow clansman drifting towards the group around Kōken, Nakamaro set out for his revolt. On a more general note, this conflict can be seen as a disagreement between two groups over the role of the Emperor, with the one around Kōken favouring direct authority as in China at the time, while on the other side Nakamaro and his followers supported the practice of pre-Tenmu times where the Emperor as high priest of kami affairs was the spiritual leader of the country while actual political power lay in the hand of the leader of an imperial ("in-law") clan.
 In order to restore authority and prestige, Nakamaro planned a coup d'état. As head of the Middle Guards he seized control of the military in the capital and neighboring provinces, placing his sons in key position at the Palace Guards and as governors of Echizen and Mino Provinces, which were strategic for access to Eastern Honshu. Two other sons (Kuzumaro and Asakari) he named to the Council of State. In return Kōken appointed Fujiwara no Masaki (a critic of Nakamaro) to "Middle Counselor" and had 69-year-old Kibi no Makibi brought back from exile. The latter had played a major role during the Hirotsugu Rebellion and was an expert in Chinese strategy. He was put in charge with the preparation of forces and the reinforcement of defensive works at the Seta River, which would turn out to cut off Nakamaro from the Eastern Provinces. On the 2nd day of the 9th month (October 1) of 764, Nakamaro asked Kōken to name him "Supervisor of Military Messengers from the Four Provinces of the Kinai, the Three Provinces of the Passes (Echizen, Mino, Ise) and Ōmi, Tanba, and Harima".
 To see whether the celestial bodies were aligned favorably for a rebellion, Nakamaro consulted the yin-yang master Ōtsu Ōura who was associated with Prince Wake, a nephew of Emperor Junnin. However the astronomer leaked the plot and was rewarded with a promotion to the 4th rank. When Kōken tried to take the imperial seal and station bells from Emperor Junnin on the 11th day of the 9th month (October 10, 764), events escalated. A struggle ensued as Nakamaro sent one of his sons to regain the objects, Kōken replied by sending two crack soldiers and eventually Nakamaro succeeded by ordering the Captain of the Middle Guards to recapture the seals and travel passes. He named the elder brother of Funado, Shioyaki the new emperor. Together with Shioyaki and carrying the signs of imperial authority, he left the capital for Ōmi.
 The Former Empress stripped Nakamaro of rank, position and surname (11th day of 9th month). To prevent his flight to the east she had the three ancient barriers (sankan (three gates)) at Suzuka, Fuwa (near what would later be Sekigahara-juku) and Arachi closed. These marked the border to the Eastern Provinces. The army that she raised, occupied the provincial headquarters (kokufu) at Ōmi and had the Seta bridge burned, so that Nakamaro had to find another escape route. Fujiwara no Kurajimaro was sent as leader of an army against Nakamaro.
 The rebel army turned north towards Echizen Province where he was counting on support from his son who was provincial governor. But again, Kōken's forces were quicker and with the help of the local elite they had the governor killed and Arachi pass blocked. Seeing no way for escape to the north or south, Nakamaro's group tried to cross Lake Biwa on a boat but had to return due to adverse wind.  Eventually it came to an archery battle on the 18th day of the 9th month (October 17, 764) from 1am to 3pm at Miozaki in Ōmi Province. When Nakamaro's side seemed to gain the upper hand, reinforcement from the capital arrived forcing the rebels to retreat. While trying to escape by boat, Nakamaro and his family were captured and executed. The rebel's head was taken as trophy to the capital. According to the Nihon Kōki, a total of 375 people who participated in the rebellion were sentenced to the death penalty, but that was subsequently commuted to exile.
 Factors cited for the failure of Nakamaro's Rebellion include the envy and lack of support from within the Fujiwara clan. Also, despite his high position as Supervisor of Military Messengers, unlike Kōken, Nakamaro did not manage to gain support from local district magistrates who had a major part of military force—particularly fighters on horseback—under their command.
 With her strongest rival out of the way, the retired Empress Kōken was left in full charge of the state of affairs. In what Bender suggests to be a triumphal procession, in 765 Kōken and other court members set out on a royal tour of the provinces of Kawachi, Izumi and Kii. Junnin, who had become Emperor through Nakamaro's support, was disliked by Kōken. In the month following the rebellion, she issued a significant edict in which titular Emperor Junnin was accused of being in collusion with the rebel. She dethroned Junnin and degraded him to the rank of a prince. Together with his mother he was exiled to Awaji Island where conditions were appalling and on an escape attempt the ex-emperor was captured and killed. Kōken became Empress for the second time as Empress Shōtoku.
 As Empress Shōtoku she surrounded herself with loyal people. Fujiwara no Toyonari, who had opposed and been exiled by his brother Nakamaro, was brought back from Dazaifu  during the revolt on the 14th day of the 9th month (October 13, 764) and reinstated as Minister of Right. She promoted Dōkyō from junior 5th to junior 3rd rank, and in 765 made him prime minister prelate (daijōdaijin zenshi). His authority was further increased on the 20th day of the 10th month, 766, to Buddhist King (Hō-ō) and on the 20th day of the 3rd month, 767 by creation of the "Imperial Office for the Buddhist King" (Hō-ō Kyūshiki). In titles he rivaled semi-legendary Prince Shōtoku and he'd also receive officials in the manner of an emperor, however Dōkyō only held spiritual (not political) responsibilities. With Dōkyō's rise in power also came an active propagation of Buddhism. Following the rebellion, Empress Shōtoku ordered the copying of the tripiṭaka, Buddhist canon, and in order to pacify the souls of those that had died during the Nakamaro Rebellion, had the Hyakumantō Darani produced — a large scale commission of miniature wooden pagodas and woodblock prints for distribution in provincial temples.
 The Fujiwara retained enough power to prevent a plan to raise Dōkyō to Emperor in 769, known as the Dōkyō Incident. When Empress Shōtoku died in 770 without leaving any children, they managed to break the Imperial line of descendants of Emperor Temmu, which they thought would always favor direct imperial rule over control by a non-imperial clan like the Fujiwara. Dōkyō was sent into exile and several Fujiwara leaders were appointed to prominent government positions. According to Zachert, the political instability and threat to the imperial line of succession due to Dōkyō during Kōken/Shōtoku's rule acted as a deterrent and Japan would not see another female ruler for close to 1000 years.