"The Muslim religion must be banned in France," Venelles mayor Robert Chardon tweeted on Thursday as his contribution to a dialogue Sarkozy had opened with the public under the hashtag #NSDirect.
Anyone practising the religion should be "immediately escorted to the border", he added.
He also called for France's law on secularism to be scrapped and the constitution be amended to declare that "the republic favours the practise of the Christian faith".
Responding to the Twitterstorm set off by Chardon's comments, Sarkozy condemned them.
"I condemn this proposal even if secularism also means fixing limits," he tweeted. "Rights and limits go together."
UMP vice-president Nathalie Kosciusko-Morizet was more forthright in her condemnation.
"I have called for the expulsion procedure to be started for these absurd statements that in now way reflect the values and programme of the UMP," she told the AFP news agency.
A little earlier Christian Estrosi, the mayor of Nice who heads the party's ticket in forthcoming regional elections in the region where Venelles is situated, declared that expulsion was under way.
Chardon told AFP that he intends to stand in the regional elections and to try to be a candidate in the 2017 presidential election.
If he is expelled from the UMP, he will set up his own party, he said.