A reputed Brooklyn gang member facing 34 counts including armed robbery and assault was released on just $6,000 bail — freeing him to allegedly sexually assault a 12-year-old girl, The Post has learned.

Tony Johnson, 17, caught a huge break when a Brooklyn judge rejected a prosecution request to set his bail at $225,000 during a March 5 arraignment on the massive indictment and instead slashed the amount by more than 97%, sources said.

The deep discount allowed Johnson’s mom to spring him from the slammer and bring him back to their home in the Breukelen Houses in Canarsie, according to the sources.

But Johnson, a reputed member of the Folk Nation gang, allegedly wreaked more havoc, with court papers detailing a series of strong-arm robberies blamed on the 6-foot-1, 280-pound teen.

On Sept. 15, Johnson allegedly snatched a cellphone from the hand of a female victim on the grounds of the sprawling Breukelen Houses, then ran off and disappeared shortly before 1 p.m.

The next day, Johnson was about two miles from home when he allegedly struck again, repeatedly punching a female victim in the face at the corner of Livonia Avenue and Bristol Street at around 4:30 p.m., court papers say.

Johnson allegedly grabbed the victim’s purse, tossed it on the ground and ran away, leaving her with facial swelling and a busted lip that sent her to the hospital.

Less than an hour later, he was back at the Breukelen Houses, where court papers say he approached and threatened a male victim.

“Give me your sneakers or I’ll stab you,” Johnson allegedly snarled.

After sticking his hands in the male’s pockets, Johnson took his victim’s footwear and fled, according to court papers.

But the teen allegedly took his viciousness to a whole new level on Oct. 8 — when he sneaked up behind a 12-year-old girl as she walked through the Breukelen Houses on her way to pick up her sister at school, sources said.

Johnson allegedly demanded the girl’s cellphone and cash, then searched her book bag for the valuables. When he found nothing worth stealing, Johnson allegedly forced the adolescent to a nearby basement, where he ordered her to take off her pants and underwear, sexually assaulted her and made her engage in a sex act, court papers say.

Johnson was busted in the sex attack and the robberies Thursday and is being held at the Horizon Juvenile Center in The Bronx — this time on a total $105,000 cash bail or $130,000 bond, Department of Correction records show.

City cops were outraged.

“It is a disgrace that this teen is allowed back out on the streets to ruin a poor girl’s life,” said a Brooklyn detective who’s familiar with the case. “Nobody ever talks about the victims. This poor girl’s life has been ruined because they gave this guy another chance he didn’t deserve.”

Another law enforcement source warned that similar situations were bound to arise once new state laws go into effect next year that eliminate bail for most nonviolent offenses and end the automatic criminal prosecution of 16- and 17-year-olds.

“This is a very scary situation,” the source said. “This poor girl is the victim of a broken system, and I’m afraid you’re going to see many more stories like this. This is just the beginning.”

Court records show the judge who set Johnson’s bail was acting state Supreme Court Justice Craig Walker, who declined on Monday to say why he overruled the request for $225,000 bail.

“We don’t comment on these things,” Walker told The Post outside his apartment. “I couldn’t even tell you the facts of that case.”

Johnson’s mother, Cheryl Johnson, 47, called the allegations against her son “ridiculous.”

“This is an African American boy being framed!” she fumed. “He’s a good kid. Very respectful. He gets along with everyone. He plays with the kids and stuff.”

She accused cops from the 69th Precinct of “harassing” her son and said she’d filed “four or five” complaints with the Internal Affairs Bureau, including one Sunday.

An NYPD spokeswoman said, “The matter is under internal review.”

Defense lawyer Jay Schwitzman, who is representing Johnson in connection with the recent robbery and sex assault charges, said his client “maintains he is innocent and will fight the charges in court.”

Additional reporting by Emily Saul and Tina Moore