It was the seat of the Ming Dynasty until 1644, when the Forbidden City was captured by rebel forces led by peasant leader Li Zicheng. He proclaimed himself Emperor of the Shun Dynasty. The last emperor of the Ming Dynasty, Chongzhen, hanged himself.
The self-proclaimed emperor Li Zicheng was soon forced to flee from the Manchus, who set fire to much of the Forbidden City.