BOSTON (AP) — A Utah man charged with viewing child pornography on a Boston-bound commercial flight won’t have to serve his jail sentence if he sticks to the terms of his probation.

Prosecutors said 50-year-old Salt Lake City resident Grant Smith pleaded guilty Thursday to possessing child pornography.

READ MORE: Newton To Keep School Mask Mandate In Effect After October 1

A Boston judge suspended Smith’s 2 1/2-year sentence and placed him on five years’ probation.

Smith must continue sex offender treatment, comply with Utah sex offender registry requirements, and follow restrictions on contact with children and Internet use.

READ MORE: Police Identify 2 Suspects Wanted In Norwood Murder

Prosecutors said a fellow first-class passenger saw Smith viewing pornographic computer images of young girls during a November 2011 flight. The passenger took a cellphone photo of the images and alerted a flight attendant.

Smith was arrested in Boston and initially pleaded not guilty. He subsequently resigned his job as a University of Utah engineering professor.

MORE NEWS: 'It Was My Dream': Bill Shields Retires After 41 Years At WBZ

Copyright 2013 The Associated Press.