Seven cops in Baltimore assigned to an elite gun task force acted like “1930s-style gangsters,” allegedly shaking down citizens they falsely detained, filed fake police reports and made bogus overtime claims, according to federal prosecutors and top police brass.

US Attorney for Maryland Rod Rosenstein told reporters during a press conference Wednesday that the accused cops participated in a “pernicious conspiracy scheme” that “tarnishes the reputation of all police officers.”

The indictment now puts scores of active cases and investigations into question in Baltimore, where the alleged criminal activity happened throughout last year — when the city’s police department was under investigation by the Justice Department for civil rights violations.

“These seven police officers acted disgracefully, they betrayed the trust we have and are trying to build upon with our community at a very sensitive time in our city’s history,” Baltimore Police Commissioner Kevin Davis said. “They acted in a manner that betrayed their fellow police officers. I’ve said on more than one occasion: Good cops hate to work with bad cops.”

The officers were arrested at the department’s internal affairs office Wednesday, according to the Baltimore Sun. They were identified as Sgt. Wayne Jenkins, 36, and Detectives Momodu Gondo, 34, Evodio Hendrix, 32, Daniel Hersl, 47, Jemell Rayam, 36, Marcus Taylor, 30, and Maurice Ward, 36.

All seven officers were charged in a racketeering indictment, while Gondo was charged in a separate drug case involving five civilians.

“These defendants were allegedly involved in stopping people who had not committed crimes, and not only seizing money but pocketing it,” Rosenstein said. “These are really robberies by people wearing police uniforms.”

During one incident in September, the officers stopped a man leaving a storage facility and said they had a warrant to search his unit though they did not, federal prosecutors said in court papers. But Hersl, Jenkins and Rayam took a sock containing $4,800 and removed $2,000 from it, prosecutors said.

On a recording, Rayam told Gondo that he had “taxed” the man, prosecutors said.

“He won’t say nothing,” Rayam replied, according to the prosecutors.

In separate incidents months earlier, prosecutors said, the officers stole drugs and $1,700 from a man they pulled over — then did not file a report on the stop — and split up a total of $70,000 they stole in July.

Some of the indicted cops have previously been accused of using excessive force or other wrongdoing. A review by the Baltimore Sun found the city has paid out more than $500,000 in settlements involving them.

The officers appeared for initial hearings in US District Court while wearing street clothes and handcuffs on Wednesday. All of the officers were ordered held pending detention hearings, which are scheduled for Thursday for all of the officers except Taylor, whose hearing is scheduled for Friday, the Baltimore Sun reports.

The city’s police union president said officials were “very disturbed” by the allegations.

“These officers are entitled to due process and a fair trial in accordance with the Constitution and the laws of our state,” Ryan said in a statement. “It would be inappropriate for me to make any further comment until the charges leveled against these officers are finally resolved.”