KAMLOOPS, B.C. -- A man who shot a Mountie at a traffic stop in Kamloops, B.C., has been sentenced to 16 and a half years in prison for what the judge called a heinous crime.

Kenneth Knutson, 38, pleaded guilty to attempted murder earlier Thursday before joint submissions for the sentence from Crown and defence lawyers.

Knutson shot Cpl. Jean-Rene Michaud in December 2014, and was arrested after a 12-hour manhunt.

He appeared in court wearing orange prison garb and periodically peered into the gallery, where 10 officers were seated, including Michaud and his wife Colleen Michaud.

Knutson was ordered to stand trial after a preliminary hearing last December before entering a guilty plea Thursday. Other charges, including aggravated assault and two firearms-related offences, were dropped against him.

Court heard Michaud pulled over a vehicle in the early hours of Dec. 3, 2014, approaching Knutson from the passenger side after the driver had failed to stop earlier.

In a statement read in court, Michaud said the vehicle's rear window was blown out. Then a gunshot hit him in the stomach, and a second shot struck him in his elbow.

He did not pull his own gun.

Police later determined six shots were fired, and two had lodged in Michaud's bulletproof vest.

B.C. Supreme Court Justice Austin Cullen said Knutson committed a heinous crime against an officer who was working to protect the community.

Michaud endured 12 surgeries and spent 112 days in hospital before returning to full-time duties in January.

His wife has said he suffered countless complications and setbacks while recovering from extensive injuries, which court heard included a collapsed lung and broken rib.

Michaud did not comment, but Supt. Brad Mueller read a statement from the Mountie at a news conference, in which he thanked the community of Kamloops and people across the country for supporting him and his family.

"We are happy to be moving forward in our lives from this and today it will make it that much easier to do so," he said.

Mueller said the day was an emotional one for his entire detachment and that the Mounties satisfied with the sentence.

Mounties have said they are conducting an internal review parallel to the criminal investigation into the shooting.

With time already spent behind bars before his guilty plea, Knutson is expected to serve 14 and a half years in prison.