Guillermo Zapata, resigned as Madrid's cultural councillor on Monday just 48 hours after accepting the role under new Madrid mayor Manuela Carmena, amid a row over anti-semitic 'jokes' that he tweeted back in 2011.
He had defended himself after tweets dating back to 2011 came to light arguing that they were made in the context of a debate on dark humour and before he went into politics.
On Sunday he closed down his Twitter account and apologized for the damage he caused but the row escalated and Carmena accepted his resignation on Monday afternoon.
The hashtag #ZapataDimision (Resign, Zapata) went viral in Spain, just one day after activists from the Indignados movement that organised mass street protests in 2011 became mayors in Madrid and Barcelona.
Zapata had made deeply offensive jokes about the Holocaust and gas chambers used by the Nazis during World War II. In another tweet, he had also taken aim at a victim of an attack by Basque separatist group ETA.
In a statement posted on social media platform Tumblr on Sunday, Zapata apologized, and said his jokes had been prompted by a debate on "the limits of humour".
Claiming he did not identify with the content of his own tweets, Zapata said he was taking part in an online debate prompted by the sacking of a columnist of national daily El Pais, after he made a joke denying the Holocaust.
"Now some of those tweets, which were written within the context of a conversation on black humour, have been recovered with the goal of presenting them as though they represented my ideas -- while in fact I do not defend them at all," Zapata wrote.
"I firmly condemn all forms of racism, and, of course, anti-Semitism. I believe the Jewish Holocaust teaches us a lesson that humanity must never forget, so that it is never repeated," he added.
The conservative mayoral candidate of Madrid, Esperanza Aguirre - whose party won the most seats but was locked out of leading City Hall after opponents struck a left-wing pact - called via Twitter on her rival Manuela Carmena to demand Zapata's resignation, or else "she will become complicit with his savagery".
The Socialists, whose support helped bring Carmena and Zapata's Ahora Madrid to power in the capital, have also demanded that the new councillor give "an immediate explanation".