A waiter in a seaside restaurant in northern Italy told the local mayor to leave because he turned up for dinner wearing cargo shorts.
The mayor of Viareggio, on the Tuscany coast, described his embarrassment on Facebook. Giorgio Del Ghingaro said he had not been told about the dress code.
"As it wasn't an official dinner, but one with some true friends, I felt free to dress casually," he wrote.
The Club Nautico says it regrets the incident and will give him membership.
Mayor Del Ghingaro posted a photo of his shorts in the Facebook post.
He said he was sitting at a table on the terrace with his friends when a waiter approached and "looking embarrassed he told me that, as I wasn't wearing long trousers, I couldn't remain there".
The mayor said he finally had a nice dinner elsewhere with his friends, but was hurt by the "minor assault" over his shorts. "I admit it was a bit humiliating," he said.
Muzio Scacciati, a representative of Club Nautico's management, said there were two notices about the dress code - at the main entrance and by the stairs.
The daily Corriere della Sera said he defended the rule about long trousers, to be worn in the restaurant after 7pm.
"I'm sorry about what happened and I hope we can clarify things with the mayor, to whom I intend to give a membership card," he said.