BEIJING (Reuters) - A court in China on Friday jailed a former chairman of Baoshan Iron and Steel, who went on to become vice mayor of Shanghai, to 17 years for bribery and graft, a state broadcaster reported.

President Xi Jinping has waged war on graft for more than four years, vowing that all corrupt officials, from powerful “tigers” to lowly “flies”, will be weeded out, and warning that a failure to do so could threaten the ruling Communist Party.

Ai Baojun had used his positions to amass more than 40 million yuan ($5.8 million) in assets from 2000 to 2014, a court in the southern city of Zhangzhou ruled, according to China Central Television (CCTV)

Ai is the most senior official from China’s financial hub to be sentenced in the corruption campaign. He could not be reached for comment.

The court also ruled that 5.8 million yuan of Ai’s personal assets be confiscated and returned to Baosteel and to Shanghai city, CCTV said.

Ai was given a lenient sentence due to actively providing details of his crimes, which he accepted and apologized for, the court said, adding that many of the bribes were accepted by relatives without his knowledge.

China’s top anti-graft watchdog stripped Ai of his party and state positions in January 2016 after an investigation found him guilty of breaking party discipline rules, as well as the crimes he was sentenced for.

According to his official biography, Ai ran Shanghai-based Baoshan Iron and Steel from 1998 to 2007 before taking up a Shanghai vice mayor post until 2013.

He then became head administrator for Shanghai’s free-trade zone, the first such zone on the Chinese mainland.

Dai Haibo, a deputy secretary of the Shanghai government and former deputy head of the free trade zone, was stripped of his post in May 2015, following an investigation by the anti-corruption watchdog.

Cui Jian, vice president of the Baosteel Group, the parent of Baoshan Iron and Steel, was placed under investigation in March 2015 on suspicion of “serious disciplinary violations,” a euphemism for graft.

Baoshan Iron and Steel declined to comment.