A man who pleaded guilty to shooting a deputy sheriff in the cheek has been sentenced to 18 months probation and ordered to serve 100 hours of community service.

Matthew D. Lovell, 19, was originally charged with attempted second-degree murder. He pleaded guilty to a reduced charge of aggravated assault, a third-degree felony, as part of a plea bargain with the Salt Lake County attorney's office, in November.Judge Raymond Uno sentenced Lovell to zero to 5 years in prison, but then stayed that sentenced and gave him 18 months probation. The judge also ordered that he be treated in an in-patient program at Charter Summit Hospital. He was also sentenced to serve 100 hours of community service in lieu of any fines, court records state.

Lovell was charged with firing several shots from inside his Salt Lake County home the night of Aug. 10. Salt Lake County deputy sheriff Craig Carroll was hit just below his right eye as he crouched beside a pickup truck after hearing shots fired from inside the house. He was the first officer to respond to a report of a fight in the area.

According to a transcript read during a court hearing, Lovell said he held the gun to his own head and then began shooting wildly at the walls and windows. Deputies said Lovell barricaded himself inside the house, then tried to escape by climbing out a window and onto the roof.