The married Texas teacher who famously flashed a broad smile in her mugshot after being accused of romping with a 17-year-old student pleaded guilty this week to the crime.

Sarah Madden Fowlkes, 28, submitted her plea Thursday to a Caldwell County judge, who has yet to accept it, according to FOX 29 San Antonio.

The agreement would require Fowlkes to serve four years deferred adjudication, pay a fine and surrender her teacher’s license, according to the report.

Her lawyer, Jason Nassour, had previously claimed Fowlkes looked so cheerful in her mugshot because she was innocent.

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

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, according to reports at the time.

Detectives launched the investigation after getting a tip 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 to police.

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