Chinese flag waves in front of the Great Hall of the People in Beijing, China, October 29, 2015. REUTERS/Jason Lee

Two officials who worked with President Xi Jinping when he governed Zhejiang province are now mayors of Beijing and Shanghai, the political and economic heavyweight cities of China.

Cai Qi, 61, was elected mayor of Beijing, while Ying Yong, 59, was elected mayor of Shanghai. Both men were elected on Friday during the fifth session of the 14th Municipal People’s Congress of their respective cities, Xinhua news agency reported.

Before Xi became the president of China, he was previously the party boss and acting governor of Zhejiang province from 2002 to 2007.

At that time, Cai served as the party boss for Quzhou and Taizhou cities in Zhejiang from 2002 to 2006. He then was deputy party boss and mayor for Hangzhou, the capital city of Zhejiang.

Ying used to served as the deputy party boss of the Provincial Public Security Bureau and Provincial Discipline Inspection Commission of Zhejiang before 2005. He was also chief of the Supreme People’s Court of Zhejiang from 2006 to 2007.