Conor McGregor just walked out of an NYC courtroom where he appeared for a hearing for his bus attack case ... and told the media, "I regret my actions that led me here today."
He continued, "I understand the seriousness of this matter and I'm hopeful that it gets resolved soon."
Inside the courtroom, Conor's attorney told the judge the UFC star is negotiating a plea deal with prosecutors. They're due back in court July 26.
McGregor was hit with multiple charges -- including felony criminal mischief -- for attacking a UFC bus at the Barclays Center in Brooklyn on April 5 ... injuring multiple people including some UFC fighters.
If convicted on all counts, Conor faces up to 7 YEARS in prison.
Conor was escorted inside the courtroom by armed police officers who were controlling the crowd and keeping the peace.
Conor looked stylish -- wearing a suit and tie. His demeanor was much different than the last time he was in court -- no billionaire strut this time. He was very reserved.