A Bradford woman has been jailed for three and a half years for three charges of sending malicious emails to Naz Shah MP and perverting the course of justice.

Sundas Alam, 30, of Princeville Street, Lidget Green, Bradford, pleaded guilty to three charges of sending malicious emails and one of perverting justice on the third day of her trial at York Crown Court.

The Recorder of York, Judge Sean Morris, warned that those who threatened MPs will receive heavy sentences.

He said: “As far as malicious communications to a member of parliament is concerned there has to be an element of deterrence especially in the light of recent tragic events”.

Judge Morris was jailing Alam for sending five “disgraceful, terrifying and shameful” emails in the same evening to her MP.

Ms Shah and her family had to flee their home in the middle of the night after Alam made threats including “do you want a bullet through your window or a rifle in your head”, a York jury heard last October.

“MPs dedicate their lives to the service of their constituents and their country,” said Judge Morris.

“They should not have to put up with threats. It should not be something that goes with the job.

He said: "Parliamentarians will be protected by the courts to ensure that others are deterred from their online threats and indeed physical threats.”

He said three people were wrongly arrested from their beds by armed police for sending the emails after Alam spoofed their emails to send the threats.

She let them give evidence before changing her plea to guilty on the third day of her trial to three charges of sending malicious emails and one of perverting justice.

The judge said she had planned that to distress one of the three, her former line manager at work.

In personal statements, the three victims spoke of the psychological and social impact of being arrested in the middle of the night “as if they were murderers, terrorists or drug dealers”.

“The trauma of that arrest can never be repaired,” said the wife.

They described how they had had to change their phones, cancel social media accounts, suffered the loss of their reputation at work and in the community, and planned to move home.

The judge made a 10-year restraining order banning Alam from contacting any of their family.

For Alam, Mark Barlow said: “The person she was intending to get at was not her MP but I accept that is what happened.”

Alam had had mental health issues at the time she sent the emails.

“She is in need of great assistance in order to deal with the issues,” he said, adding that two people were available to give her the treatment she needed.

The jury heard Alam had asked Ms Shah for help after she was sacked by West Yorkshire Community Rehabilitation Company for sending inappropriate messages to her line manager via its internal message system.

Ms Shah suggested she go to employment law solicitors. The judge said the advice was “quite correct”.

The jury heard how Alam had sent the emails late on April 3, four days after she was released under investigation suspected of harassing her former line manager online.