A former Murrieta high school teacher who carried on a sexual relationship with one of her students was given a two-year prison sentence Wednesday and ordered to register as a sex offender.

Shannon Sears Fosgett, 45, pleaded guilty in May to felony charges stemming from her encounters with the boy, whose identity was not released, beginning in the fall of 2014 at Murrieta Valley High School.

Under her plea agreement with the Riverside County District Attorney's Office, Fosgett admitted two counts of oral copulation of a minor, as well as one count each of statutory rape, contacting a minor with the intent to commit a sex offense, witness intimidation, and a misdemeanor charge of annoying a child.

In exchange for her admissions, prosecutors dropped a related statutory rape charge, along with misdemeanor counts of contributing to the delinquency of a minor and furnishing alcohol to an underage person. Superior Court Judge John Monterosso certified the terms of the plea deal and imposed the sentence stipulated by the prosecution and defense.

According to police, Murrieta Valley Unified School District officials reported the youth's encounters with Fosgett in November 2015 -- about a year after the two had their first illicit rendezvous. The boy told authorities that he and the teacher began communicating via text-messaging after class one day and continued to do so in the ensuing weeks.

"As the relationship grew, the minor and teacher engaged in oral sex and ultimately sexual intercourse," said Murrieta police Lt. Ron Driscoll.

Word of the relationship leaked to administrators at the school, who alerted the district, culminating in Fosgett's resignation on Dec. 2, 2015. She has a prior misdemeanor conviction for driving under the influence, according to court records.