Kang Xi ascended the throne at age 8 after Shun Zhi abdicated to become a monk following the death of his favorite concubine. With the help of Grand Empress Dowager Xiao Zhuang, Kang Xi overcame a fierce power struggle against Ao Bai and eventually took control of the country himself. Later he would defeat rebellious former Ming generals Wu Sangui, Shang Kexi and Geng Jinmao, annex Taiwan, and triumph over Ge Er Dan. During his rule of 61 years, the longest in Chinese history, the country enjoyed unprecedented growth and prosperity.