UFC star Conor McGregor is formally arraigned in a Brooklyn courthouse.

He's being charged with three counts of misdemeanor assault and criminal mischief for allegedly attacking a bus filled with Ultimate Fighting Championship fighters Thursday afternoon at Barclays Center.

Fighter Cian Cowley, who was part of McGregor's entourage, also faces assault and criminal mischief charges.

The judge ordered McGregor to stay away from some of the other fighters -- including on social media.

He was released on $50,000 bail.

Police say a feud between McGregor and another fighter may have sparked the incident.

"There was a dispute about a vacated title and from what we understand, the person he had the dispute with was not injured. He was on the bus though," said Chief of Detectives Robert Boyce.

McGregor was caught on camera lifting a barricade, trying to throw it at the bus.

He then apparently hurled a hand dolly through the window — injuring two fighters.

Both were taken off the card scheduled for Saturday night at Barclays.

A third fighter, Artem Lubov, was also yanked from the card due to his alleged participation in the incident.

McGregor is due back in court June 14.