A former California middle school teacher claimed in court that she was pressured into giving an eighth-grade student oral sex — because she felt threatened that the boy would expose their relationship if she refused.

Justine Karen Nelson, a married 33-year-old former teacher at Tenaya Middle School in Fresno, testified Wednesday in Fresno Superior Court that she succumbed to pressure to be intimate — including kissing and oral sex — after exchanging nearly 100 pages of Instagram messages with the boy, the Fresno Bee reported.

The student was 13 at the time, while Nelson was a 31-year-old mother of one who has acknowledged knowing their relationship was inappropriate, but felt powerless to stop it due to potentially losing her job and custody of her child.

But a prosecutor disputed that version of events, asking Nelson to show proof the teen threatened her in any way. Nelson replied that she was unable to do so since the coercion happened in person, the newspaper reported.

Nelson testified that the eighth-grader came into her classroom at one point and pushed her onto a desk before kissing her, prompting her to scream his name before the teen ran off. Nelson said she hoped her husband, who also worked at the school as a gym teacher, would hear her scream, but he did not.

When asked if she kissed him back, Nelson admitted it was possible.

“It’s a natural instinct to kiss a child who just pushed you down on a desk?” Deputy District Attorney Liz Owen asked, which Nelson affirmed, the Bee reported.

Nelson also testified that the student incessantly pressured her to give him oral sex. She then gave in to his demands at one point, saying she considered herself out of options.

“I just wanted to get it over with,” an emotional Nelson testified. “I was so sick and tired.”

Nelson denied having romantic feelings for the teen, testifying that she “just cared about him as a person,” according to the newspaper.

The teen, who is now a 16-year-old high school freshman, testified last week that Nelson initiated their relationship and invited him to her classroom, where she kissed him and later gave him oral sex. The sex act occurred several times, he testified, sometimes in the middle of the school day between classes and after school.

Nelson, who is facing felony charges of lewd or lascivious acts with a minor and oral copulation, faces more than eight years in prison if convicted. Closing arguments in the case are expected Monday, the Fresno Bee reports.