Ying Yong was elected mayor of Shanghai on Friday, the local legislature said.
The election was held on the last day of the annual session of the Shanghai Municipal People's Congress.
Ying, 59, a native of Xianju county in Zhejiang province, had been serving as Shanghai's deputy Party chief since June 2014 and was elected executive deputy mayor in September.
Previously he had worked as the president and Party chief of the higher people's courts in Shanghai and neighboring Zhejiang province.
Shanghai's legislature approved the resignation of Yang Xiong, the city's previous mayor, on Tuesday.