Ji Jianye was found guilty of taking USD 1.9 million in bribes from 1999 to 2012, the Yantai Intermediate People's Court said on its Sina Weibo microblog.
Authorities have also confiscated property worth USD 325,000 from the former mayor, who was nicknamed "Bulldozer Ji" for his relentless promotion of construction projects in his city.
"The court was lenient in meting out punishment, as Ji admitted his guilt and showed repentance," the court said in a statement posted on its microblog.
The court is in the eastern province of Shandong, while Nanjing is the capital of neighbouring Jiangsu.
More From This Section
China typically holds corruption trials outside the area where alleged crimes took place, to separate accused officials from their local power bases.
Ji spent his entire political career in Jiangsu, heading the cities of Kunshan and Yangzhou before taking the Nanjing post in 2010.
He was expelled from the Communist Party in January last year, when authorities claimed he had "received a huge amount of money and gifts either by himself or through his family members".
Ji's trial underscores the vast amounts of ill-gotten wealth amassed by some Chinese officials, although his case is far from the most sensational to come to light under Xi's anti-corruption campaign.
In February, Ni Fake, a former deputy governor of the eastern province of Anhui, was sentenced to 17 years in jail for taking around USD 2.1 million in bribes in cash, artefacts and precious stones.
The ruling Communist Party's top anti-graft body said Ni was "obsessed with collecting jade" and had appointed himself honorary chairman of the provincial jewellery industry association, according to an earlier report by the state-run Shanghai Daily newspaper.