Conor McGregor is admitting culpability for an early April incident at Barclays Center and will avoid prison because of it.

The UFC star reached a plea deal with the Brooklyn district attorney’s office Thursday, pleading guilty to a single violation of disorderly conduct but avoiding a jail sentence or a blemish on his criminal record, according to ESPN.

McGregor initially faced up to 12 criminal charges after he and several members of his team attacked a bus carrying UFC fighters and personnel in the bowels of the Barclays Center at UFC Media Day prior to UFC 223. Footage of the incident caught McGregor throwing what appeared to be a guardrail through a window of the bus, injuring fighter Michael Chiesa and forcing him to withdraw from the UFC 223 card.

In lieu of jail time, McGregor must pay full restitution to the bus company for any damages suffered — which he already did, according to ESPN.com’s Brett Okamoto — perform five days of community service and take an anger management program lasting one to three days.

While some predicted a much harsher punishment at the time of the incident, the Brooklyn court’s ruling Thursday appeared to be in line with how proceedings were going, as McGregor never was indicted for his crime.

The ruling also means the 30-year-old still could return to the octagon this year. The Ireland native’s coach recently insisted McGregor will fight Khabib Nurmagomedov — who was on the bus McGregor attacked — before the end of the calendar year, so a superfight still very much is on the table.