Shia LaBeouf admitted Wednesday to acting up at a Broadway show, pleading guilty to disorderly conduct in one of several episodes of bizarre behavior the former "Transformers" star has displayed in recent years.
LaBeouf, whose representatives have said has gotten treatment for an alcohol problem since his June arrest, somberly answered a judge's questions as he pleaded guilty in a deal that involves no jail time or probation. If he stays in treatment for at least three months and out of trouble for six, he will be allowed to withdraw the guilty plea and the case will be dismissed.
"Are you pleading guilty because you are guilty?" Manhattan Criminal Court Judge Diana Boyar asked, a standard question in such pleas.
"Yes, your honor," LaBeouf said.
He declined to comment as he left court encircled by news cameras.
"We appreciate the thoughtfulness of the resolution of the matter by the (Manhattan) district attorney's office," said his lawyer, G. Robert Gage.
LaBeouf, 28, was watching Alan Cumming and Michelle Williams in a "Cabaret" revival on June 24 when he started smoking cigarettes, yelling at the actors onstage, and swearing at security guards and hollering as he was escorted out: "Do you know who I am?" according to court papers. Taken to a police precinct, he spat at an officer's feet, according to the documents.
He faced charges including a misdemeanor trespassing offense and some non-criminal violations, disorderly conduct among them.
Assistant District Attorney Alyssa Russell told the judge that prosecutors had made the plea agreement "based on the fact that the defendant has been in continuous treatment since his arrest."
Outside court, Gage declined to detail the treatment. LaBeouf's publicist said in July he was voluntarily was being treated for alcoholism but hadn't checked into a rehab facility. She didn't immediately respond to an inquiry Wednesday.
It's not uncommon in Manhattan for such cases to be resolved with agreements to dismiss them if a defendant stays out of trouble.
Best known for starring in the first three "Transformers" movies, LaBeouf has gotten attention for a number of off-screen incidents in the past year.
He apologized this winter for borrowing the story line and dialogue for a short film from a graphic novel writer. In February, he walked out of a Berlin Film Festival news conference for the movie "Nymphomaniac Volume I" and then wore a paper bag — emblazoned with "I am not famous anymore" — over his head at the red carpet premiere.
The actor was arrested on a drunken driving charge in Los Angeles in 2008 after he crashed his pickup truck, injuring his hand and knee; police said he wasn't at fault for the wreck, as another driver had run a red light. Prosecutors ultimately said there wasn't enough evidence to charge him.
WATCH: Four4Four: Taylor Swift wet T-shirt contested