Chris Brown has avoided jail by pleading guilty in court to assaulting Rihanna.

The US R&B singer's lawyer made the guilty plea just hours before Brown's ex Rihanna arrived in court, meaning she wouldn't have to testify against him.

Brown was ordered to perform six months of community service and told he must stay at least 50 yards away from Rihanna for the next five years.

He will also serve five years probation for felony assault and be made to attend domestic violence counselling sessions.

Rihanna was left battered and bruised after Brown attacked her on the evening of the Grammy awards early in February this year.

Brown's progress will be monitored by the court at regular three-month intervals.