Omar Omeirat, Social Democrat candidate for the town council of Filipstad, central Sweden, gave a speech in the town on Friday evening advocating diversity and openness.
On Saturday he sang a very different tune.
"The entire Muslim world is sitting and watching while our brothers and sisters in Palestine are slaughtered by the Jewish pigs," Omeritat wrote on his Facebook page.
"May Allah strengthen those who defend Palestine, and be merciful towards the dead Muslims. Amen."
His Facebook page also included a flag used by the Islamist group Isis, local paper NWT reported.
The post quickly became public knowledge, and the young politician came under fire for his choice of words.
"I called Omar about what he had written, and he said that he had watched a film where Palestinian women and children were murdered by Jews," Åsa Hååkman Feldt, Social Democrat spokeswoman in Filipstad, told The Local.
Omeirat quickly regretted the post, and updated his Facebook status to an apology.
"He never meant to judge people who are Jews, Christians, or anything else," Feldt explained. "He just meant to judge Israel as a state."
On Tuesday it was announced he would be stepping down from his position.
"I regret what I said," Omeirat told Sveriges Television. "It was the wrong choice of words and no one should say something like that."
Story continues below…
Feldt confirmed that Omeirat had decided to leave politics, and said it was entirely his own choice.
"Of course we condemn his statement," Feldt told The Local. "But it is Omar himself who has decided that he should take the consequences for his actions and leave the party."
Feldt called the situation "unusual", saying that the most common reason to step down is sickness. She explained that the town's voting slips are already printed and that Omeirat's name will still be on the list, but that he will not be eligible for a position in autumn elections.
"You really have to think about what you write on Facebook, especially as a politician," Feldt added. "It's a public record and there are consequences."