CALGARY - A man who has admitted he threatened to kill hundreds of people at last year's Calgary Stampede is to be sentenced Thursday.

Patrick Deegan, 29, pleaded guilty in January to uttering death threats, possession of unauthorized firearms and two counts of breaching conditions.

According to an agreed statement of facts, Deegan admitted he sent an email from his account to the Calgary Fire Department on May 26, 2013.

The email warned there was going to be an attack at the Stampede and that there would be many casualties.

"There is going to be a machine-gun attack at the Calgary Stampede this year," the email read.

"Two MG-52s rated at 1800 rpm. There will be over 1,000+ casualties."

Deegan said in the email that the guns could fire off more than 1,000 rounds before malfunctioning.

At the time the email was sent, Deegan was on a 12-month peace bond related to domestic violence. One of the bond’s conditions was that he wasn’t allowed to purchase or possess any sort of firearm.

The email prompted a police investigation that led to the homes and vehicles of Deegan, his girlfriend and his parents.

Court heard police found an AR-15 semi-automatic rifle, a Lee Enfield bolt-action rifle and a Norinco semi-automatic rifle at the home of Deegan's parent.

One of the weapons had been purchased under the name of Deegan's employer, The Shooting Edge, a firearms and tactical equipment dealer and indoor shooting range.

The prosecution has argued that Deegan should be sentenced to three to five years in prison. The defence is requesting probation.

Deegan, who apologized to the court during his sentencing hearing, remains in police custody.

Follow @BillGraveland on Twitter

Also on HuffPost