Ezra Millerpleaded guilty to a lesser chargein an agreement with prosecutors to drop two charges, including felony burglary.

The actor, 30, arrived in person with their lawyer for the hearing at Vermont’s Bennington County Superior Court on Friday morning, where Judge Kerry Ann McDonald-Cady reviewed the terms of the change-of-plea agreement and sentencing.

Rather than pursue a jury trial, Miller opted to plead guilty to misdemeanor unlawful trespass, admitting they were on the victim’s property May 1, 2022, in Stamford, Vermont, without the owner’s permission.

The felony burglary and petit larceny charges are dismissed without prejudice, meaning the case is closed if the yearlong probation is not violated. (Miller wasfacing charges after allegedly taking alcohol from a man’s homein Stamford. The actorentered not guilty pleasto the felony charges in October.)

Vermont Superior Courts

Ezra Miller court

Never miss a story — sign up forPEOPLE’s free weekly newsletterto get the biggest news of the week delivered to your inbox every Friday.

The prosecutor said the agreement “has the benefit of ensuring the compliance with the conditions, which protect the victim, but it also allows the defendant to continue their employment as well as continue the mental health treatment. So, given all that, the victim is in support of the agreement.”

Ezra Miller court

The judge said she found that the agreement is “very sound” and an “equal balance between rehabilitation and punishment.”

Ezra Miller.Bruce Glikas/FilmMagic

NEW YORK, NY - APRIL 22: Ezra Miller poses at “Harry Potter and The Cursed Child parts 1 & 2” on Broadway opening night at The Lyric Theatre on April 22, 2018 in New York City. (Photo by Bruce Glikas/Bruce Glikas/FilmMagic)

Aftermonths of alarming behaviorand other arrests, the actor — who stars in the upcomingThe Flashfilm, scheduled to be released in theaters June 16 — issued a statement in August apologizing, saying they were seeking treatment for mental health issues.

“Having recently gone through a time of intense crisis, I now understand that I am suffering complex mental health issues and have begun ongoing treatment,” Miller said in a statement at the time. “Iwant to apologize to everyonethat I have alarmed and upset with my past behavior. I am committed to doing the necessary work to get back to a healthy, safe and productive stage in my life.”

source: people.com