The trial of the woman who sent death threats to an MP ended dramatically when she changed her pleas.

On Day Three of the hearing at York Crown Court, Sundas Alam pleaded guilty to three charges of sending malicious emails and one of perverting the course of justice.

The jury heard how Bradford West MP Naz Shah was so distressed and worried by the five emails sent by Alam in an evening she dialled 999 to get the police. Two of the emails were duplicates.

Alam, 30, of Princeville Street, Lidget Green, Bradford, was remanded in custody.

The Recorder of York, Judge Sean Morris, adjourned sentence until November 29 while North Yorkshire Probation Service prepares a pre-sentence report and a psychiatrist also writes a report on her.

The jury had been told that today they would see CCTV stills and video taken in Bradford stores on Alam on her phone at the time she sent the emails using the stores’ free WiFi.

The prosecution had been expected to end its case today and Alam begin her case.

But at the start of proceedings, the defence asked for the indictment to be put again.

Alam then entered all her pleas.

The jury heard that she spoofed two emails addresses belonging to relatives of her line manager to send the emails and that she did so to get her former line manager into trouble.

She had been sacked from West Yorkshire Community Rehabilitation Company because she had sent him inappropriate messages on the company’s internal message system.

The line manager and both relatives were arrested by armed police four hours after the MP rang 999 and held in custody for 20 hours before police worked out who had really sent the emails.

In their evidence, all three denied sending the emails.

The jury then heard technical evidence from a police expert on how a member of the public can get access to software that enables them to send emails purporting to come from an address other than the one they are actually sent from.