Actor Ezra Miller pleaded guilty Friday to a charge stemming from a break-in and theft of alcohol at a neighbor's home in Vermont, one of a string of arrests and reports of erratic behavior last year that stretched from Hawaii to New England.

Miller, who appeared in several "Justice League" movies and stars in the upcoming film "The Flash," agreed that by entering the plea and abiding by the conditions, they would avoid a three-month jail sentence for a misdemeanor charge of unlawful trespass, a $500 fine and a court fee, a year of probation, and conditions including continued mental health treatment.

Two other charges were dropped, including a felony burglary count that could have carried a sentence of 25 years in prison, but Vermont Superior Court Judge Kerry Ann McDonald-Cady told Miller the felony charge could be refiled if they fail to abide by the details of probation.

'THE FLASH' ACTOR EZRA MILLER PLANS TO ACCEPT PLEA DEAL IN VERMONT TRESPASSING CASE

During the nearly 30-minute hearing in Bennington, Miller, 30, answered the judge's questions but declined to make a statement. However, after the hearing, Miller's attorney, Lisa Shelkrot, sent a statement on the actor's behalf.

Ezra Miller at an award show

Ezra Miller is shown attending an event at the Brooklyn Navy Yard in New York on Nov. 5, 2018. Miller pleaded guilty to charges relating to a Vermont break-in and was ordered to pay a fine and serve a year of probation. (Evan Agostini/Invision/AP, File)

"Ezra would like to thank the court and the community for their trust and patience throughout this process, and would once again like to acknowledge the love and support they have received from their family and friends, who continue to be a vital presence in their ongoing mental health," the statement said.

'THE FLASH' STAR EZRA MILLER SEEN IN COURT, PLEADS NOT GUILTY TO BURGLARY CHARGES, FACES 26 YEARS IN PRISON

Miller pleaded not guilty in October to stealing liquor from a neighbor’s home in Vermont. State police responded to a burglary complaint in Stamford on May 1 and found that several bottles of alcohol had been taken while the homeowner was away.

The homeowner said he had been friends with Miller for about 18 years and bought the home a year and half ago in Stamford, where Miller also had a home, according to the police affidavit. Miller was charged after police consulted surveillance footage and interviewed witnesses.

CLICK HERE TO GET THE FOX NEWS APP

Miller was arrested twice last year in Hawaii, including for disorderly conduct and harassment at a karaoke bar.