The Yongle Emperor’s Jingnan Campaign and the Move to Beijing
Also called: Jingnan rebellion, Forbidden City
When the Jianwen Emperor curbed the power of his uncles after Hongwu’s death, Zhu Di, Prince of Yan, rose in 1399 (the Jingnan campaign), took Nanjing in 1402 and became the Yongle Emperor. In 1421 he moved the capital to his own base, Beijing.

Unknown author · Public domain · Source
Hongwu had enfeoffed his sons as princes to guard the frontiers. When his grandson, the Jianwen Emperor, came to the throne in 1398 and began cutting back the princes’ power, Zhu Di, Prince of Yan, who held Beiping (Beijing), rose in 1399 claiming to “clear away the evil ministers around the emperor” — the Jingnan (“quelling the troubles”) campaign. After three years of civil war Nanjing fell in 1402 and Jianwen vanished.
As emperor, Yongle led five campaigns into Mongolia, occupied Vietnam (1407) and sent Zheng He into the southern seas to add tributary states. In 1403 he renamed Beiping as Beijing, built the Forbidden City there and formally moved the capital in 1421. He created Grand Secretaries of the Inner Court to assist the emperor, relied on eunuchs and set up the Eastern Depot, and had the Yongle Encyclopedia and the Great Compendia of the Four Books and of Neo-Confucianism compiled.
King Taejong of Joseon was invested by Yongle in 1403, stabilising relations with the Ming, and after the move Joseon envoys travelled to Beijing on regular missions every year.