A man who was charged with firing at police officers in two separate incidents in 2012 appeared in court Monday, and learned his sentence.

Patrick Young, 23, appeared in court in Edmonton Monday, and entered guilty pleas to five charges, including aggravated assault against a police officer and possession of a weapon.

He was sentenced by a judge to ten years behind bars, minus time served.

“Shooting at the police is extremely serious, and that requires a very severe sentence,” Crown Prosecutor Neil Wiberg said. “Denunciation and deterrence are the two primary factors in this kind of sentencing, so it has to be a lengthy sentence.”

The charges were laid against Young for two incidents that saw officers fired at – the first took place on December 23, 2012.

In that incident, Edmonton police had pulled over Young’s vehicle during a routine traffic stop – before Young got out of the car, walked towards their vehicle, and fired once at the police car with a sawed-off shotgun.

The bullet missed officers, and police returned fire – no one was hurt, and Young fled the scene.

Then, on Christmas Day of that year, officers tracked Young to a motel in Redwater, northeast of Edmonton.

In that incident, Young fired two or three shots – no one was injured, but a seven-hour standoff ensued before he was taken into custody.

After the incident, Young faced a total of 31 charges, but the rest of the charges were stayed Monday.

With files from Sarah Richter