The court ruled that Vassilis Papageorgopoulos was a key part of a scam that lasted between 1999 and 2008.
It is believed to be the longest sentence given to any Greek politician convicted of corruption.
After sentencing, Papageorgopoulos continued to protest his innocence.
"I declare that I have nothing to do with this case," he told the Thessaloniki court, according to Greek media.
"Some people will go to their graves weighed down by remorse."
He said his trial had been turned into a "political process".
Papageorgopoulos was mayor of Thessaloniki from 1999 to 2010 after serving as deputy sports minister in the early 1990s.
Also sentenced to life were the city's former general secretary, Michalis Lemoussias, and former treasurer Panagiotis Saxonis.
All three are expected to appeal.
The court heard that Saxonis was responsible for forwarding to social security funds the contributions from council workers' salaries.
Prosecutors said he kept that money and, after taking a 10% cut, forwarded the rest to Lemoussias who split it with Papageorgopoulos.
The court was told that the funds were initially banked in a joint account in the names of Papageorgopoulos and Lemoussias.
Prosecutors began investigating the city's accounts following complaints that millions of euros were missing.
The BBC's Mark Lowen in Athens says the Greek political class has long been perceived as "untouchable", although plagued by scandals and clientelism.
In 2012 the watchdog Transparency International named Greece as the most corrupt country in the European Union.
However, a culture of accountability is beginning to emerge, our correspondent adds, and as Greeks battle with austerity, there is a growing clamour for politicians to be held responsible for their actions.