WASECA, Minn. — A man was sentenced Friday to the maximum 35 years in prison for shooting a southern Minnesota police officer in the head, leaving him severely injured.

Tyler Robert Janovsky told the court he was "deeply sorry" for the January shooting of Waseca police Officer Arik Matson, the Mankato Free Press reported.

"I hope and pray officer Matson makes a full recovery and his family finds some closure," he said.

Janovsky was wanted on drug charges when Matson and other officers responded to a suspicious person report Jan. 6 in a residential area. Janovsky climbed onto a garage and shot at Matson and two other officers, hitting Matson in the head. Officers returned fire and Janovsky sustained wounds that were not life-threatening.

Janovsky pleaded guilty to two counts of attempted first-degree murder of a police officer in July. A third count of attempted murder was dismissed, along with a weapons charge and prior drug charges.

Matson spent months in hospitals and rehabilitation facilities. While he doesn't remember the night he was shot, he told the court that he remembers waking up in a hospital bed, the pain and frustration that followed, and how the shooting changed his life forever.

"From this day forward I chose to live life to the fullest, trust God's plan and never take anything for granted," Matson said.

Matson told the courtroom he "would still respond to that call if it were tomorrow."

Both Waseca County Attorney Rachel Cornelius and Judge Christine Long said Janovsky's 35-year prison sentence was not enough, but it is the maximum allowed under state guidelines.

"The law doesn't account for if the officer or officers are gravely injured. It doesn't account for if they almost die, if they have to relearn how to eat, walk and talk and possibly never return to work," she said.

Matson returned home to Freeborn last month. His wife, Megan Matson, said in her victim impact statement that his journey to recovery is not over.

"Sometimes you have to let go of the picture of what you thought life would be like and find the joy in the story you are living," she said. "We have found joy and we will keep living."