A BIOLOGY teacher, 28, who famously smiled for her mugshot has admitted having sex with her 17-year-old pupil.

Sarah Madden Fowlkes, of Lockhart, Texas, will be hoping to avoid jail after submitting her guilty plea to a judge on Thursday.

It comes after her lawyer Jason Nassour previously claimed Fowlkes, who is married, looked so cheerful in her mugshot because she was innocent.

He told NBC at the time: “This isn’t a guilty person sitting there like they just got caught. When everything’s fleshed out, it won’t be as it appears.”

The Caldwell County judge is yet to accept the agreement, which would require Fowlkes to serve four years deferred adjudication - either probation or community service.

She'd also have to pay a fine and surrender her teacher’s license, according to FOX 29 San Antonio.

Fowlkes, who taught anatomy and physiology at Lockhart High School, was accused of engaging in “sexual content with the intent to arouse or gratify the sexual desire” of the student in March 2017.

Fowlkes was charged with having an improper relationship with the lad after turning herself in to cops in March last year.

Detectives had already launched an investigation days earlier after a tip-off from a school administrator.

The probe led them to the boy, who had been in touch with Fowlkes, cops said.

“Their contact was of a sexual nature,” police said.

She was suspended after turning herself in.

Her since-deleted bio on the school’s website says she previously taught third and fifth grade at Plum Creek Elementary School in Lockhart.

She made headlines when her grinning police mugshot was shared online.

In one snap she wears a grey cardigan, before removing it for another pose where she bares all of her teeth.

She has reportedly been married since 2013 and celebrated her birthday at a restaurant with her husband the night before she was arrested.

According to her page on the school’s website she started working at Lockhart High in September 2016.

On the site she wrote: “I have very high expectations of myself as a teacher as well as of my students and I hope that this will be a formula for achievement.

“I want this to be an enjoyable year for all of my students but also a productive, challenging and encouraging year with success for everyone.”