Yiannis Boutaris, 75, was kicked in the head and legs and beaten with bottles by a group of nationalists angry over his appearance at a remembrance event, the BBC reported.
The mayor, who is known for his anti-nationalist views, was attending a ceremony to mark the killing of ethnic Greeks by Turks in World War One.
Politicians have condemned the attack.
A dozen people approached Boutaris demanding he leave a flag-lowering ceremony in Thessaloniki on Saturday to mark what is known in Greece as the "Pontic Genocide", Thessaloniki city council president Calypso Goula said.
Goula, who was also attending the event, described seeing several men throw bottles at Boutaris and kicking the mayor in the head and legs after he had fallen down.
"It was a nightmare," Boutaris was quoted by the Greek Reporter website as saying.
"There were several people that attacked me. They were hitting me everywhere."
The mayor's aides helped to get him away from the attackers, and take him to hospital where he was reportedly kept in overnight.
Prime Minister Alexis Tsipras, in a statement, called the attackers "far-right bullies who have to face the consequences of their actions".
Greece's ruling left-wing Syriza party described it as a "fascist attempt to target and intimidate" the mayor.
The main opposition party, New Democracy, also condemned the attack and called on the perpetrators to be "arrested immediately".