HAMMOND, Ind. (STMW) — A former Hammond high school teacher will move forward with pleading guilty to possessing pornographic images of two former students, the Post-Tribune reports.

Attorneys in the case against Jon Erik Lilly, 27, of Cedar Lake, filed an amended plea agreement Monday in the U.S. District Court in Hammond.

READ MORE: Chicago Weather: Rain Tapers Saturday Night, But More Scattered Showers Sunday

The new agreement says that in exchange for Lilly pleading guilty to two counts of possessing child pornography, federal attorneys will recommend that he serve 12 years in prison.

The original plea agreement, filed last week, would have bound a federal judge to the 12-year sentence if he accepted the plea agreement.

Court records show that during a status conference with U.S. District Judge Lozano a day after that agreement was filed, attorneys said they would file a motion to withdraw it.

Although it’s unclear why they made the change, federal judges in the past have objected to plea agreements calling for a binding sentence.

READ MORE: At Least 16 People Shot, 1 Killed In Gun Violence In Chicago This Weekend

Lilly was arrested earlier this year after students alerted officials at Morton High School, where he taught math, that he was having sex with a student.

The two at first denied any improper relationships, but the then-17-year-old girl eventually told police they had had sex for several months. Police also found naked images of the girl that she had texted to Lilly.

The second charge is for another student, then 16, who Lilly started texting, telling her how she was one of his best students. He asked her to send him photos, and she sent several showing herself topless. She told police she stopped after he winked at her in school, according to court filings.

A status hearing in the case is set for Tuesday.

MORE NEWS: At Bond Hearing For Man Authorities Say Was With Him, Prosecutors Say 13-Year-Old Adam Toledo Had Gun In Hand When He Was Fatally Shot By Police

(Source: Sun-Times Media Wire © Chicago Sun-Times 2013. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)