A man has been charged with assault after Jeremy Corbyn was hit from behind with an egg during a visit to a mosque in London on Sunday.

John Murphy, 31, from Barnet, north London, will appear at Highbury Corner magistrates court on 19 March, the Metropolitan police said.

Murphy allegedly screamed: “When you vote, you get what you vote for,” as he approached from behind and hit the Labour leader over the head with the egg.

Corbyn had been visiting the Finsbury Park mosque, which is in his constituency, with Diane Abbott, the shadow home secretary, as part of the annual Visit My Mosque Day. The pair were speaking with community leaders when the incident happened.

Corbyn was unharmed and continued with the planned programme, leaving the mosque with a police escort on Sunday evening.

On Monday he tweeted a photo of himself taking part in the day’s event and thanking organisers.

Thank you to mosques across the country for opening your doors to people of all faiths and none on #VisitMyMosque Day.



It was a great opportunity to see first-hand the great work that so many mosques are doing in their communities. pic.twitter.com/6IU2foz22W — Jeremy Corbyn (@jeremycorbyn) March 4, 2019

Murphy was reportedly not a regular visitor to the mosque and had been waiting inside the building.

Finsbury Park mosque was the site of a terrorist attack in June 2017 when Darren Osborne, who had been radicalised by far-right anti-Muslim views on the internet, drove a rented van at a group of worshippers, killing Makram Ali and injuring others.

Concerns about potential attacks on politicians have been heightened since the murder of the Labour MP Jo Cox by another far-right terrorist, Thomas Mair, in 2016.

The Labour MP Jess Phillips tweeted after the Corbyn incident: “Acts of violence against politicians, loses your argument, lessens your cause and demeans our democracy. It’s also just horrid. Don’t do it. If you don’t agree with him raise your voice not your fists.”