 Having returned to China, Zheng joined the secretariat of the reformist statesman Zhang Zhidong in Nanjing and followed him to Beijing, where Zheng obtained a position in the Qing foreign office, the Zongli Yamen.Following the abortive Hundred Days' Reform in 1898, Zheng left his post in Beijing and took up a number of important government positions in central and southern China.After the collapse of the imperial system in 1911, Zheng remained loyal to the Qing dynasty and refused to serve under China's Republican government.