, known first as  and later as  until his accession, was the 38th emperor of Japan who reigned from 668 to 671. He was the son of Emperor Seimei and Empress Kōgyoku (Empress Saimei), and his children included Empress Jitō, Empress Genmei, and Emperor Kōbun.

In 645, Tenji and Fujiwara no Kamatari defeated Soga no Emishi and Iruka. He established a new government and carried out political reforms. He then assumed real political power as the crown prince of both the Kōtoku and Saimei Emperors. Despite the death of Emperor Saimei, he did not accede to the throne for seven years, and came to the throne after the relocation of the capital to Ōmi in 668. He created Japan's first family register, the Kōgo Nenjaku, and the first code of law, the Ōmi Code.

Traditional narrative

He was the son of Emperor Jomei, but was preceded as ruler by his mother Empress Saimei.

Prior to his accession, he was known as .

Events of Tenji's life
As prince, Naka no Ōe played a crucial role in ending the near-total control the Soga clan had over the imperial family. In 644, seeing the Soga continue to gain power, he conspired with Nakatomi no Kamatari and Soga no Kurayamada no Ishikawa no Maro to assassinate Soga no Iruka in what has come to be known as the Isshi Incident. Although the assassination did not go exactly as planned, Iruka was killed, and his father and predecessor, Soga no Emishi, committed suicide soon after. Following the Isshi Incident, Iruka's adherents dispersed largely without a fight, and Naka no Ōe was named heir apparent. He also married the daughter of his ally Soga no Kurayamada, thus ensuring that a significant portion of the Soga clan's power was on his side.

Events of Tenji's reign
Naka no Ōe reigned as Emperor Tenji from 661 to 672.

 661: In the , the empress designated her son as her heir; and modern scholars construe this as meaning that this son would have received the succession (senso) after her death or abdication.  Shortly after, she died, and Emperor Tenji could be said to have acceded to the throne (sokui).
 662: Tenji is said to have compiled the first Japanese legal code known to modern historians. The Ōmi Code, consisting of 22 volumes, was promulgated in the last year of Tenji's reign.  This legal codification is no longer extant, but it is said to have been refined in what is known as the Asuka Kiyomihara ritsu-ryō of 689; and these are understood to have been a forerunner of the Taihō ritsu-ryō of 701.
 663: Tenji invaded Korea in an attempt to support a revival of Japan's ally Paekche (one of Korea's Three Kingdoms, which had been conquered by the Korean kingdom of Silla in 660) but was seriously defeated at the Battle of Baekgang by the combined forces of Silla and Tang China. 
 668: An account in  becomes the first mention of petrochemical oil in Japan. In the , flammable water (possibly petroleum) was presented as an offering to Emperor Tenji from Echigo Province (now known as a part of Niigata Prefecture). This presentation coincided with the emperor's ceremonial confirmation as emperor.  He had postponed formalities during the period that the mausoleum of his mother was being constructed; and when the work was finished, he could delay no longer.  Up until this time, although he had been de facto monarch, he had retained the title of Crown Prince.
 671: An account in Nihon Shoki becomes the first mention of public announcement of time by rōkoku (a kind of water clock) in Japan. In 660 also a mention of this kind of clock exists.

Tenji was particularly active in improving the military institutions which had been established during the Taika Reforms.

Death of the emperor

Following his death in 672, there ensued a succession dispute between his fourteen children (many by different mothers). In the end, he was succeeded by his son, Prince Ōtomo, also known as Emperor Kōbun, then by Tenji's brother Prince Ōama, also known as Emperor Tenmu. Almost one hundred years after Tenji's death, the throne passed to his grandson Emperor Kōnin.

Post-Meiji chronology
 In the 10th year of Tenji, in the 11th month (671): Emperor Tenji, in the , designated his son as his heir; and modern scholars construe this as meaning that the son would have received the succession (senso) after his father's death.  Shortly thereafter, Emperor Kōbun is said to have acceded to the throne (sokui).  If this understanding were valid, then it would follow:
 In the 1st year of Kōbun (672): Emperor Kōbun, in the 1st year of his reign (弘文天皇元年), died; and his uncle Ōaomi-shinnō received the succession (senso) after the death of his nephew.  Shortly thereafter, Emperor Tenmu could be said to have acceded to the throne (sokui).

Pre-Meiji chronology
Prior to the 19th century, Ōtomo was understood to have been a mere interloper, a pretender, an anomaly; and therefore, if that commonly accepted understanding were to have been valid, then it would have followed:
 In the 10th year of Tenji, in the 11th month (671): Emperor Tenji, in the , died; and despite any military confrontations which ensued, the brother of the dead sovereign would have received the succession (senso);  and after a time, it would have been understood that Emperor Tenmu rightfully acceded to the throne (sokui).

The actual site of Tenji's grave is known.  This emperor is traditionally venerated at a memorial Shinto shrine (misasagi) at Yamashina-ku, Kyoto.

The Imperial Household Agency designates this location as Tenji's mausoleum.  It is formally named Yamashina no misasagi.

Poetry
The Man'yōshū includes poems attributed to emperors and empresses; and according to Donald Keene, evolving Man'yōshū studies have affected the interpretation of even simple narratives like "The Three Hills."  The poem was long considered to be about two male hills in a quarrel over a female hill, but scholars now consider that Kagu and Miminashi might be female hills in love with the same male hill, Unebi.  This still-unresolved enigma in poetic form is said to have been composed by Emperor Tenji while he was still Crown Prince during the reign of Empress Saimei:

One of his poems was chosen by Fujiwara no Teika as the first in the popular Hyakunin Isshu anthology:

After his death, his wife, Empress Yamato wrote a song of longing about her husband.

Kugyo
The top  during Emperor Tenji's reign included:

 Daijō-daijin: , 671–672.
 Naishin (内臣): Fujiwara no Kamatari (藤原鎌足) (614–669), 645–669.

Prince Ōtomo (Ōtomo-shinnō) was the favorite son of Emperor Tenji; and he was also the first to be accorded the title of Daijō-daijin.

Non-nengō period
The years of Tenji's reign are not linked by scholars to any era or nengō.  The Taika era innovation of naming time periods – nengō – languished until Mommu reasserted an imperial right by proclaiming the commencement of Taihō in 701 (aside from the momentary proclamation of the Shuchō era under Emperor Tenmu in 686).
 See Japanese era name – "Non-nengo periods"
 See Tenji period (661).

In this context, Brown and Ishida's translation of Gukanshō offers an explanation about the years of Empress Jitō's reign which muddies a sense of easy clarity in the pre-Taiho time-frame:
"The eras that fell in this reign were: (1) the remaining seven years of Shuchō [(686+7=692?)]; and (2) Taika, which was four years long [695–698]. (The first year of this era was kinoto-hitsuji [695].)  ... In the third year of the Taka era [697], Empress Jitō yielded the throne to the Crown Prince."

Consorts and children
Empress: Yamato Hime no Ōkimi (倭姫王), Prince Furuhito-no-Ōe's daughter (son of Emperor Jomei).

Hin: Soga no Ochi-no-iratsume (蘇我遠智娘, d. ), Soga no Kura-no-yamada no Ishikawa-no-maro's daughter
First Daughter: Princess Ōta (大田皇女), married to Emperor Tenmu
Second Daughter: Princess Uno-no-sarara (鸕野讃良皇女) later Empress Jitō
Second Son: Prince Takeru (建皇子, 651–658)

Hin: Soga no Mei-no-iratsume (蘇我姪娘), Soga no Kura-no-yamada no Ishikawa-no-maro's daughter
Third Daughter: Princess Minabe (御名部皇女), married to Prince Takechi
Fourth Daughter: Princess Abe/Ahe (阿閇皇女) later Empress Genmei, married to Prince Kusakabe

Hin: Soga no Hitachi-no-iratsume (蘇我常陸娘), Soga no Akae's daughter
Princess Yamabe (山辺皇女), married to Prince Ōtsu

Hin: Abe no Tachibana-no-iratsume (阿部橘娘, d. 681), Abe no Kurahashi-maro's daughter
Princess Asuka (明日香皇女), married to Prince Osakabe
Princess Niitabe (新田部皇女), married to Emperor Tenmu
10th son: Prince Ōama, later Emperor Tenmu

Court lady: Koshi-no-michi no Iratsume (越道伊羅都売)
Seventh Son: Prince Shiki (施基皇子/志貴皇子, d. 716), Father of Emperor Kōnin

Court lady (Uneme): Yakako-no-iratsume, a lower court lady from Iga (伊賀采女宅子娘) (Iga no Uneme)
First Son: Prince Ōtomo (大友皇子) later Emperor Kōbun
 Prince Abe (阿閇皇子, b.648)
 Princess Aga (阿雅皇女, 648-709)

Court lady: Oshinumi no Shikibuko-no-iratsume (忍海色夫古娘), Oshinumi Zokuryu's daughter
Third Son: Prince Kawashima (川島皇子, 657–691)
Princess Ōe (大江皇女), married to Emperor Tenmu
Princess Izumi (泉皇女), Saiō in Ise Shrine (701–706)

Court lady: Kurikuma no Kurohime-no-iratsume (栗隈黒媛娘), Kurikuma Tokuman's daughter
Princess Minushi (水主皇女)

Popular culture
 Portrayed by Ahn Hong-jin in the 2012–2013 KBS1 TV series Dream of the Emperor.

Ancestry

See also
 Emperor of Japan
 List of Emperors of Japan
 Imperial cult
 Kōryū-ji
 Omi Shrine

Notes

References
 Asakawa, Kan'ichi. (1903).    The Early Institutional Life of Japan. Tokyo: Shueisha. ;  see online, multi-formatted, full-text book at openlibrary.org
 Aston, William George. (1896).  Nihongi: Chronicles of Japan from the Earliest Times to A.D. 697. London: Kegan Paul, Trench, Trubner. 
 Brown, Delmer M. and Ichirō Ishida, eds. (1979).  Gukanshō: The Future and the Past. Berkeley: University of California Press. ; 
 MacCauley, Clay. (1900). "Hyakunin-Isshu: Single Songs of a Hundred Poets" in Transactions of the Asia Society of Japan. Tokyo: Asia Society of Japan.  ...Click link for digitized, full-text copy of this book (in English)
 Nippon Gakujutsu Shinkokai (1969). The Manyoshu: The Nippon Gakujutsu Shinkokai Translation of One Thousand Poems. New York: Columbia University Press. 
 Ponsonby-Fane, Richard Arthur Brabazon. (1959).  The Imperial House of Japan. Kyoto: Ponsonby Memorial Society. 
 
 Titsingh, Isaac. (1834). Nihon Ōdai Ichiran; ou,  Annales des empereurs du Japon.  Paris: Royal Asiatic Society, Oriental Translation Fund of Great Britain and Ireland. 
 Varley, H. Paul. (1980).  Jinnō Shōtōki: A Chronicle of Gods and Sovereigns. New York: Columbia University Press. ; 

 
 

 
Japanese emperors
626 births
672 deaths
People of Asuka-period Japan
7th-century monarchs in Asia
7th-century Japanese monarchs
Man'yō poets
Hyakunin Isshu poets
Sons of emperors
7th-century Japanese poets