Live updates: Follow the latest news on Israel-Gaza
The Islamic Centre Munich distanced itself from the post by Mohamed Ibrahim, saying it had felt “shock and grief” at the events of October 7.
Mr Ibrahim said his post had been misunderstood and was made when he was not yet fully aware of events in Israel.
A backlash over the post was blamed in part for torpedoing an interfaith prayer for peace in Israel and Gaza that had been planned in Munich on Monday night.
The city's Mayor, Dieter Reiter, said it was clear that “the time is not ripe” for such an event after a Jewish representative pulled out.
Volker Beck, a former Green Party MP and president of the German-Israeli Society, had accused the imam of mocking victims of the attack on Israel.
“These are the kind of people with whom Mayor Reiter wanted to pray for peace,” Mr Beck said.
Mr Ibrahim's now-deleted post on October 7 was accompanied by a smiley face emoji and read: “Everyone has their own way of celebrating October.”
In a statement this week, he said that by “celebrating October” he meant an October 6 holiday in Egypt commemorating a war with Israel in 1973.
When he heard news of the attack on Israel, he posted a comment that was meant to be “humorous or sarcastic”, Mr Ibrahim said.
“At that time I was not fully aware of the events of October 7 or their consequences,” he said. “I formally apologise that my post has led to misunderstandings.
“Far be it from me to mock the civilian victims of October 7. That cannot be reconciled in any way with my ethical Islamic values.”
The Islamic Centre Munich – which state intelligence services regard as being under the umbrella of the Muslim Brotherhood – said it decided in an emergency session to suspend the imam until “accusations are clarified”.
The centre's leadership “wishes to distance itself in the clearest terms from the post on October 7 by our imam Mohamed Ibrahim”, a statement said.
“We took the events of October 7 with great shock and grief for the innocent victims, as well as great worry about the wider future of the Middle East region.
“Under no circumstances can we as the German Muslim community allow that hatred and violence are transferred from the Middle East to Jews and Muslims in Germany.”
German President Frank-Walter Steinmeier convened Jewish and Muslim leaders at the presidential palace this week amid high tensions arising from the conflict.
Senior figures including Chancellor Olaf Scholz said on Thursday they were ashamed by an eruption of anti-Semitism, as Germany marked 85 years since the Kristallnacht pogrom that ushered in the Holocaust.