James Dalton, who is standing for the UK Independence Party in Barnsley East, responded to a tweet from comedian Ricky Gervais who told his followers voting Labour would 'keep Theresa May out'.
Mr Dalton wrote: "Quite right Ricky! And the only way of keeping Islam out is a vote for #UKIP. Tell us your best Mohammed joke will you?"
His words sparked fury on Twitter.
Andrew Bogg tweeted 'absolutely disgusted by this', adding 'if you can tell the difference between the KKK and Christians you should be able to do the same with extremists and Muslims'.
David Elston wrote: "Surely someone like yourself understands freedom of expression, freedom of speech... and freedom of religion?"
And @__jonnyg replied simply: "You're enough of a joke for all of us."
When The Star asked Mr Dalton for a comment, he replied: "Read the Koran and Hadiths, read @DouglasKMurray 's book 'The Strange Death of Europe' - then ask me again. 'll be glad to talk."
He then added: "Life is a long road. Do as I suggest and one day you may understand. Best wishes. Make time to learn. Open yr mind."
The other candidates in Barnsley East vying for your votes in the general election tomorrow are: Tony Devoy (The Yorkshire Party), Andrew Lloyd (Conservative), Stephanie Peacock (Labour), Kevin Riddiough (English Democrats) and Nicola Turner (Liberal Democrats).
Polling stations will be open tomorrow (Thursday, June 8) from 7am to 10pm.
EXCLUSIVE: Sheffield bids to bring Channel 4 headquarters to the cityUPDATE: Police arrest man over firearms incident near MeadowhallBody of terror attack victim brought back to Sheffield as family release statementTragedy of Sheffield sex worker and mum-of-one stabbed 19 times in car park by savage killerKFC in Sheffield city centre closes for refurbishmentGeneral Election 2017: Who's standing in South Yorkshire?A midfield quartet at the centre of Sheffield Wednesday's recruitment driveDaily Debate: How many goals will Ched Evans score for Sheffield United?Sheffield Wednesday: Get all the latest Owls statsSheffield United: Get all the Blades stats