Exclusive Details

Judge Joe Brown just got a taste of his own medicine -- the former TV judge was arrested after allegedly blowing a gasket at a Memphis juvenile court ... TMZ has confirmed.

Brown showed up to court Monday to represent someone in a child support case -- but was turned away by court staff, who informed Brown they had no record of the case in question.

Brown reportedly lost it ... becoming verbally abusive and was warned several times to quiet down.

We're told Brown -- who is running for D.A. of Shelby County -- was "playing to the peanut gallery" and "incited a near riot."

Brown reportedly ignored the judge and was subsequently arrested for contempt of court.

Brown was cited for contempt 5 times and ultimately ordered to spend 5 days in jail. He left under his own power and was screaming the entire time. Check out the audio from court ... it's wild.