Conor McGregor is being released from custody and most likely getting ready to fly back to Ireland after appearing in court where he was arraigned on charges stemming from the UFC bus attack.

McGregor stood silently as the judge listed the charges against him — 3 misdemeanor assault charges and 1 felony criminal mischief charge.

The judge stuck to the bail plan and set his bond at $50k. The judge also allowed McGregor to keep his passport … meaning he can fly home to Ireland.

The judge also ordered Conor to stay away from the victims of the attack, which include UFC fighters Michael Chiesa and Ray Borg.

We broke the story … McGregor turned himself in late Thursday night to NYPD in Brooklyn … and spent the night at the police station before being cuffed and transported to court.

Chiesa was injured in the attack — and was forced to pull out of his UFC 223 fight. Chiesa met with police twice on Thursday … and ultimately decided to file a report against McGregor.

McGregor is due back in court on June 14.

[TMZ]