Muslim voters in Birmingham were told they must vote Labour or risk going to hell, an Election Court heard in a challenge against Labour Party councilor Ansar Ali Khan, who was re-elected with a huge majority in May’s general election.

Khan beat his rivals by a majority of 7,802, the largest margin in the city, the Birmingham Mail reports.

However, a case was brought against the councilor after Liberal Democrat candidate Shamsur Rehman noticed a Facebook post that suggests religious leaders in the area had urged their followers to vote Labour.

In the post, which was shared online on April 15, the leader of a local mosque, Pir Siddiqui, is pictured with eight Labour candidates, including Khan. The caption on the photo reads: “All Pir, Sahiban and Darbars in Birmingham have ordered Mureeds to vote Labour in elections.”

Rehman told Commissioner Timothy Straker QC the meaning of the post was clear, and that religious leaders had tried to persuade their congregation to vote Labour.

When Straker asked whether the post suggested a person who failed to vote Labour “would, after they died, go to hell,” Rehman answered: “Yes, that’s the suggestion.”

However, defense barrister Gavin Millar said it was not clear what time the Facebook post had been seen, saved or printed. It was also unclear who posted the original photo and which user had added the offending comment.

The photo was taken on April 19 at the Milad Muslim festival, which saw candidates from all competing parties speak.

Millar accused Rehman of hypocrisy, as he too posed for a similar photo only a day later.

“Lib Dems were meeting with the Pir, being on a photo with him, posting the photo on Facebook and appearing at the Milad with him. Exactly the same thing you are accusing my client of,” Millar said.

“It’s hypocritical to criticize my client for doing exactly what you have done.”

However, Rehman said Khan had worked on a “strong relationship” with the Pir, which had given him an advantage during the election.

“Get the mosque on your side and you are well on the way to getting voted in in predominantly Asian areas. The mosque is the kingmaker,” he said.