SANTA ANA ( — An ex-Orange County high school teacher pleaded guilty Monday to having a sexual relationship with a former 17-year-old student.

Scott Adrian Peterson, 50, accepted a plea bargain, according to Deputy District Attorney Nicole Varner.

READ MORE: Garcetti: 88,000 Vaccines To Be Given Out During The Week At City Sites

He pleaded guilty to two counts of unlawful sexual intercourse, four counts of oral copulation of a minor, and two counts of sexual penetration by foreign object of a minor, which are all felonies.

Peterson, a Spanish teacher at Orange High School, met the then 17-year-old girl when she was one of his students.

Prosecutors said they started their sexual relationship in April 2010 and had sex at a motel in Orange.

The former teacher took sexual pictures of the couple and then text messaged those images to the girl.

READ MORE: 'I Was Desperate': Prince Harry And Meghan's Bombshell Interview

Peterson and girl are currently in a relationship and were seen holding hands in the courtroom on Monday, according to attorney Todd Spitzer.

Peterson will be sentenced Oct. 5.

He was supposed to be sentenced to more than four years in prison, but because of new prison overcrowding laws, he will serve 16 months in jail and the rest of the time under supervision, according to Varner.

Peterson will not have to register as a sex offender.

MORE NEWS: Woman, Child Found Dead Inside Rancho Cucamonga Home

(©2012 CBS Local Media, a division of CBS Radio Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. Wire services contributed to this report.)