Lesson learned: Don't slap your attorney's butt after a big victory in court or you could end up in jail.

Former NFL star Chad Johnson went before a Florida judge Monday to enter a plea for his probation violation charge that would've kept him out of jail, but the judge angrily reversed her acceptance of that deal after Johnson gave his attorney a congratulatory pat on the behind for the win. A video of the incident was posted on TMZ.com.

"Are you satisfied with the assistance of your attorney?" judge Kathleen McHugh asked. "You should be. He's an excellent attorney and did a great job for you, sir."

Johnson then reached behind is attorney, Adam Swickle, patting his butt, and the court erupted in laughter.

Moments later the judge slammed Johnson for the outburst.

"I don't know that you're taking this whole thing seriously," McHugh told Johnson. "I just saw you slap your attorney on the backside. Is there something funny about this?"

Johnson protested and Swickle tried to smooth things over, but the judge abruptly rejected the plea deal, and Johnson, 35, was taken into custody.

"Love me through the good and the bad because I'm gone love you regardless... See you in 30?" Johnson tweeted hours later. He was set to begin his senence last night.

Mastic man charged in shooting ... Bethpage Shoprite expanding ... New place for family fun  Credit: Newsday

NUMC former leaders under state probe ... Mastic man charged in shooting ... Santos investigated by DOJ ... Car insurance rates could drop?

Mastic man charged in shooting ... Bethpage Shoprite expanding ... New place for family fun  Credit: Newsday

NUMC former leaders under state probe ... Mastic man charged in shooting ... Santos investigated by DOJ ... Car insurance rates could drop?

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME