UFC fighter Conor McGregor has avoided jail over an incident in New York in April which left two opponents injured.
A Brooklyn court ordered the Dublin native to complete five days of community service and complete an anger management course.
His co-accused, Cian Cowley, was also given community service and instructed to complete an anger management programme.
Both men pleaded guilty to disorderly conduct but the original felony charges against them were dropped, allowing the men to avoid a criminal trial.
Announcing the plea agreement in Kings County Courthouse in Brooklyn, Judge Raymond Rodriguez also ordered the two men to stay away from the men who were injured in the attack on a bus outside the Brooklyn Center on April 5th.
Mr McGregor was ordered to stay away from three individuals in total - Raymond Borg, Michael Chiesa and Jason Ledbetter - until July 25th 2020.
“If you violate this order you will be arrested for criminal contempt,” Judge Rodriguez said as he confirmed the plea agreement in Kings County Courthouse in Brooklyn.
Mr McGregor, dressed in a navy pinstripe suit, was present in court for the sentencing.
The court heard that Mr McGregor had paid restitution for the damage he had caused to the bus.
Mr McGregor had been charged with assault, criminal mischief, reckless endangerment and menacing before the plea bargain was made.
The 30 year-old made a brief statement to the media after the hearing, before leaving in a black SUV vehicle.
“I’m thankful to the DA [district attorney] and the judge for allowing me to move forward,” he said. “I want to say to my friends, my family, my fans, thank you for the support. Thank you.”
Speaking outside the court, Mr McGregor’s lawyer Bruce Mafeo said the outcome would have no impact on his client’s immigration status and that the time and date of the community service would be decided by the district attorney office.
“This is the same outcome that would have occurred if he was a non-celebrity,” he said.
It is expected that Mr McGregor will be required to complete his community service in the New York area within the next year.
It is also understood that Mr McGregor will spend some time in the United States before returning to Ireland.
Mr McGregor's manager Audie Attar said that the sentencing was "the best outcome we could have hoped for".
“We’re very pleased with the outcome today, very thankful to the courts, to the judge,” he said after the hearing.
He said he expected the UFC champion to return to work in 2018 but he declined to give a specific date.
“Conor is going to continue to train, and hopefully we will have some good news soon in terms of his return.” He said he could not comment on whether the fighter would face disciplinary action from the UFC.
Mr Attar also defended Mr McGregor's decision to attend the World Cup final in Moscow earlier this month as a guest of Vladimir Putin.
“He was going for the World Cup finals. I think the way the media spun it to become some kind of political visit was out of context,” said Mr Attar, who joined the UFC fighter at the Moscow event.
“We went to the World Cup finals as a guest of the countries. We were honoured to be a guest of the countries, and of the President. It’s a monumental sporting event that every sporting fan wishes to go to.”
Mr Attar said “people spun it to make it seem it was something that it wasn’t”.
Mr McGregor, who has kept a relatively low-profile on social media since his arrest in April, posted a picture of himself with the Russian president. “This man is one of the greatest leaders of our time and I was honoured to attend such a landmark event alongside him,” he wrote on twitter.