In the 13th century two rival branches of the Imperial Family emerged --- the Jimyōin, descended from the 89th Emperor Go-Fukakasa, and the Daikakuji, descended from the 90th Emperor Kameyama (Go-Fusakusa's full brother). Go-Fukakasa abdicated in 1260 and Kameyama in 1270. Each brother had spent the better part of his respective reign trying to overthrow the other. Kamayama's son, Go-Uda, succeeded him, but relations between the two brothers (and their respective families) remained strained. Finally, Hōjo Sadatoki, the shikken of the Kakamura bakufu, decided that the Jimyōin and the Daikakuji should succeed each other alternately. The claimant of each branch would occupy the throne for ten years and then abdicate in favor of the other branch (the so-called Bunpō Compromise).
The arrangement broke down in 1331 when the 96th Emperor Go-Daigo, a grandson of Emperor Kameyama (Daikakuji), tried to make his eldest son, Prince Takanago, crown prince. Hōjo Takatoki and the Jimyōin branch of the Imperial Family announced their intention to place Prince Kazuhito of the Jimyōin line on the throne. Go-Daigo declared the Hōjo rebels and fled Kyoto, taking with him the shinki, the traditional symbols of imperial authority ---- the sword, the jewel and the mirror. Between 1336 and 1392 there were two rival Imperial Courts -- one in Kyoto in the north (called the Hokuchō) and the other at Yoshino in the south (called the Nanchō).
The first five emperors of the northern court -- Kōgon, Kōmyō, Sukō, Go-Kōgon and Go-Enyu -- are regarded as illegitimate since they did not possess the shinki. After fifty-seven years, the southern (and arguably legitimate) branch of the Imperial Family surrendered to the northern branch.