Former Tory council candidate Joshua Spencer was sentenced to nine weeks' imprisonment and handed a 10-year restraining order at Leeds Magistrates' Court on Friday.

The 25-year-old constituent of the senior Labour MP wrote that he was working to get Ms Cooper "hurt" over her opposition to a no-deal Brexit, the Guardian reported.

Conservative MP Andrea Jenkyns released a statement insisting she stands by her decision to give the reference read in court.

Sign up to our daily newsletter The i newsletter cut through the noise Sign up Thanks for signing up! Sorry, there seem to be some issues. Please try again later. Submitting...

Andrea Jenkyns

The MP for Morley and Outwood said: "I have known Joshua for a number of years.

"I stand by my decision to have given him a personal reference.

"Josh has bipolar and had mental health issues since his father's suicide in 2015 and I was, and remain, concerned about his emotional and mental well-being and wanted to make absolutely sure it was taken into consideration as part of the judicial process.

"I will be seeking assurances that he will get the support he clearly needs as part of his rehabilitation."

The Guardian reported that he sent a message in April to a man he met on a dating website saying Ms Cooper should "pay" after MPs voted to delay Brexit past March 29.

"We should have left no deal on the 29th before the whore Yvette got her hands on to it and voted to revoke democracy. She will pay. I'm already organising... to hurt her," he wrote.

"Amazing what crackheads will do for £100. I'm going to get her beat up."

In another message, he said: "If you make peaceful revolution difficult you make a violent one inevitable."

Spencer was a Conservative candidate for the Wakefield Council elections in May, which was reportedly a month after his arrest.

The activist, of Knottingley, West Yorkshire, admitted a charge of sending an offensive, indecent, obscene or menacing message by a public communication network.

The restraining order demands he does not contact Ms Cooper, including on social media, or go near her constituency office for 10 years, court staff said.