Chad Johnson and Evelyn Lozada
Chad Johnson and ex-wife Evelyn Lozada

NFL player Chad Johnson has been sentenced to 30 days in prison after slapping his lawyer on the backside in court.

The former Miami Dolphins star, who has been on probation since pleading guilty to headbutting his former wife, Evelyn Lozada, in 2012, appeared in court for violating the terms of the judge's order.

After reaching an agreement with prosecutors, he expected to be handed a community service order and counselling at the hearing.

But Judge Kathleen McHugh rejected the no-jail plea deal after Johnson playfully slapped his lawyer, Adam Swickle, on the backside to celebrate.

"I don't know that you're taking this whole thing seriously. I just saw you slap your attorney on the backside. Is there something funny about this?" she said after the courtroom erupted in laughter.

"The whole courtroom was laughing. I'm not going to accept these plea negotiations. This isn't a joke."

Johnson protested that slap was not meant to provoke a reaction and tried to apologise for his actions.

"This is your courtroom. I have no intention to make this a joke. It's not funny," he said. "My life is in a shambles right now and I try my best to laugh and keep a smile on my face."

But McHugh remained unmoved and Johnson was handcuffed and hauled away to jail.

Johnson, later told his fans on Twitter: "Love me through the good and the bad because I'm gone love you regardless ... See you in 30."

In August Lozada filed for divorce after just 44 days following a violent altercation at their home during which Johnson headbutted her.