Taiwan has a new president and she’s a woman. In winning the island’s general election last weekend, Tsai Ing-wen became the first female head of government in the past 100 years in Greater China.

A number of women helped run the state in pre-modern China; one even reigned as a “female emperor”. A majority of these women acquired political power through their status as wives, mothers or daughters of emperors. One notable exception was Shangguan Waner (AD664-710).

When she was an infant, her grandfather – a prime minister during the Tang dynasty – was executed and the Shangguan clan purged. Waner was conscripted into the palace as a slave. Her fortunes turned when, at the age of 14, she was freed from slavery by Empress Wu, the woman responsible for having her grandfather killed. Impressed by her intelligence and talent for writing prose and poetry, Wu put Shangguan in charge of drafting her decrees.

After Wu proclaimed herself “emperor” in AD690, Shangguan rose to become one of the more powerful officials in court, earning the nickname “the female prime minister”.

After Wu died, in AD705, Shangguan became a consort of Wu’s son Emperor Zhongzong, but remained an influential powerbroker. However, her political manoeuvring could not save her in the coups and counter-coups that followed the death of Zhongzong, in AD710, and she was executed by Li Longji, a scion of the imperial clan, that same year.