The reputed gang member who cursed out a Brooklyn prosecutor in court got scolded on Wednesday for his vulgar tantrum.

Tony Johnson, 17, nodded as acting state Supreme Court Justice Craig Walker told him that the outrageous behavior “will not be repeated.”

“Every time you appeared before me I’ve treated you with nothing but respect and I expect the same respect from you,” Walker said.

“It doesn’t do anyone any favors when there are outbursts in the courtroom.”

On Tuesday, Walker did nothing when Johnson, a reputed member of the Folk Nation gang, erupted at Assistant District Attorney Michele Haddad following his arraignment in a grisly Oct. 8 sex attack on a 12-year-old girl.

“F–king bitch! F–king bitch!,” Johnson screamed before court officers hustled him out.

At the time of the sex assault, Johnson was free on $6,000 bond that Walker set on March 5, following the teen’s indictment on 34 counts of armed robbery, assault and other charges, The Post exclusively revealed on Monday.

The prosecution wanted Johnson’s bail to be set at $225,000, law-enforcement sources have said.

Johnson allegedly also robbed three teens – including a 16-year-old girl who was repeatedly punched in the face – while free on bail in September.

He was in court Wednesday for the announcement of two new indictments.

One charges him with first-degree criminal sexual act and the other with first- and second-degree robbery, prosecutor Song Liu said.

Johnson didn’t enter a plea in either case, and his arraignment was set for Nov. 14.

Following the brief proceeding, a man who identified himself as Johnson’s uncle went on an extended rant in the hallway.

“You don’t have evidence! You all don’t have probable cause! Right is right! Wrong is wrong!” he fumed.