Emperor Tenji (天智天皇, Tenji Tennō), born in 626 and died in 672, also known as Prince Naka no Ōe (中大兄皇子, Naka no Ōe no Ōji) and Emperor Tenchi, was the thirty-eighth emperor of Japan, according to the traditional order of succession. He reigned from 661 until his death.
Tenji was the son of Emperor Jomei and Empress Kōgyoku. He had many wives and children.
Upon the death of his father emperor Jomei in 642, his mother became empress under the name Kōgyoku.
During this first reign, the Soga clan acquired almost total power over the court. In 644, the one who was still only Prince Naka no Ōe planned a coup with Nakatomi no Kamatari and Soga no Kurayamada no Ishikawa no Maro.
The following year, he assassinated Soga no Iruka at court, in front of the throne of Kōgyoku (Isshi incident). Although the assassination did not go as planned, Iruka was killed, and his father and predecessor Soga no Emishi committed suicide soon after.
Following the incident, Iruka's followers disperse without a fight, and Naka no Ōe is named crown prince. He also marries the daughter of his ally Soga no Kurayamada, thus securing the support of a significant portion of the Soga clan's power.
Shocked, Kōgyoku abdicated in favor of her son, but he refused and had Kōgyoku's brother put on the throne, who became emperor Kōtoku on July 12, 645. During his reign, it was in fact Naka no Ōe who de facto ruled Japan.
Together with the emperor and Nakatomi no Kamatari, they set up the Taika reform in 646.
After Kōtoku's death in 655, he again refused to ascend the throne and his mother became empress again under the name Saimei. However, as under the reign of Kōtoku, it is the crown prince who reigns in effect.
In 660, the Korean kingdom of Paekche was attacked and nearly destroyed by the neighboring kingdom of Silla, and Japan came to the aid of the Paekche loyalists in an attempt to recover their territory. Saimei leaves with an army to the west coast of Japan, but dies in 661 as she is about to embark for Korea.
Naka no Ōe succeeded his mother as Emperor Tenji. During his reign, he compiles the first code of laws of Japan known to modern historians in 662.
He sent the support army to Korea in 663 led by Abe no Hirafu, but it was defeated by the combined armies of the Silla and Tang China in the battle of Hakusukinoe.
In 667, he moved his capital from Naniwa to Ōtsu on Lake Biwa, where he compiled the Ōmi code in 668. In 671, he first announced the time by the hydraulic clock.
After his death in 672, a succession dispute broke out between his fourteen children (from several different mothers). In the end, he was succeeded by his son Prince Ōtomo, who became Emperor Kōbun. Among his children, two of his daughters would also become empresses, Jitō and Genmei.