SALT LAKE CITY — A former Cache County sheriff's deputy was sentenced to probation and community service Monday after his police K-9 died in hot car over the summer.

Jason Whittier, 36, was ordered to complete 100 hours of community service and serve one year on probation for aggravated cruelty of an animal, a class B misdemeanor. A 180-day jail sentence was suspended, but could be imposed if Whittier fails to comply with the terms of his probation.

At least 50 hours of Whittier's community service must be spent working with an animal shelter to warn the public about the dangers of leaving pets in hot cars, according to court documents. Whittier will also be required to prepare a two-page report suggesting any policies or procedures that could help police departments avoid similar tragedies.

Whittier was charged in July after investigators said the dog in his care, an 8-year-old Belgian Malinois named Endy, was left in the back of a police vehicle in direct sunlight for nearly 12 hours while Whittier went to a family function.

Whittier apologized for the dog's death as he was sentenced Monday.

"All I can say is I made a mistake," Whittier said. "I loved that dog like family. I have lost a lot, but to do it all over again, I would lose everything but the dog."

First District Judge Thomas Willmore told Whittier, who has been widely criticized for the dog's death, that his community service is not meant to shame him publicly, according to the Herald Journal.

"You have lost a lot, and the county has lost a lot," Willmore said.

Prior to the hearing, several people submitted letters to the judge voicing support for Whittier, including his children's teachers, neighbors and longtime friends.

One family friend wrote that since Endy's death, Whittier has suffered as he was publicly ridiculed and abandoned by the sheriff's office. Whittier had been working two jobs to make ends meet, the friend claimed, and had barely slept on the day Endy died.

"If he wouldn't have been up all night would he have remembered his dog? No one can say for sure. I do know that he has paid dearly for this mistake. Jason has lost his job, he went two months without any income to support his family. He will never be a police officer again and the public humiliation has been more (than) he and his family can handle," the friend wrote.

One woman from Salt Lake City also wrote the court expressing outrage over the dog's death.

"There is no excuse for a 38-year-old police officer to be so careless. He did not think once of poor Endy," the woman wrote.

On July 3, Whittier had parked his truck in an area where there was "limited to no shade and was subject to direct sunlight during most of the day," charges state, then went inside his house to get ready for family activities that were planned that day, "inexplicably leaving Endy in his patrol truck."

The temperature in Cache County that day was about 94 degrees.

When Whittier returned home about 11:30 p.m. and did not find Endy in his kennel, he went to his truck, where he found the dog deceased, according to the charges.

"When Jason realized what had happened he was inconsolable," one of the letters stated. "He went through grief counseling and is still haunted by this extremely horrible accident."

Cache County Sheriff Chad Jensen blamed Endy's death on "distraction." Whittier was fired from the department just over a month after the dog's death.

Endy first started working with the Logan Police Department in 2010. In 2016, the dog was sold to the Cache County Sheriff's Office after his handler was involved in a serious traffic accident. Whittier became Endy's handler at that point.

Contributing: Associated Press