NEW YORK — A federal appeals court on Thursday blocked a judge’s ruling that found the New York Police Department’s stop-and-frisk policy was discriminatory and took the unusual step of removing her from the case, saying interviews she gave during the trial called her impartiality into question.

The 2nd U.S. Circuit Court of Appeals in Manhattan said the rulings by U.S. District Judge Shira A. Scheindlin will be stayed pending the outcome of an appeal by the city.

The judge had ruled in August the city violated the Constitution in how it carried out its program of stopping and questioning people.

The city appealed her findings and her remedial orders, including a decision to assign a monitor to help the police department change its policy and the training program associated with it. But the city said police officers are afraid to stop and frisk people now and the number of stop-and-frisks has dropped dramatically.

The three-judge appeals panel, which heard arguments on the requested stay on Tuesday, noted that the case might be affected in a major way by next week’s mayoral election.

Democratic candidate Bill de Blasio, who’s leading in polls, has sharply criticized and promised to reform the NYPD’s stop-and-frisk technique, saying it unfairly targets minorities. He said he was “extremely disappointed” in Thursday’s decision.

“We have to end the overuse of stop and frisk – and any delay only means a continued and unnecessary rift between our police and the people they protect,” he said in a statement.

The appeals court said the judge needed to be removed because she ran afoul of the code of conduct for U.S. judges in part by compromising the necessity for a judge to avoid the appearance of partiality.

It noted she had given a series of media interviews and public statements responding to criticism of the court. In a footnote, it cited interviews with the New York Law Journal, The Associated Press and The New Yorker magazine.

In the AP interview, Scheindlin labeled as a “below-the-belt attack” on judicial independence reports that Mayor Michael Bloomberg had reviewed her record to show that most of her 15 written “search and seizure” rulings since she took the bench in 1994 had gone against law enforcement. She said it was “quite disgraceful” if the mayor’s office was behind the study.

The 2nd Circuit said the cases challenging stop-and-frisk policies will be assigned to a different judge chosen randomly.

It said the new presiding judge shall stay all proceedings pending further rulings by it.

After a 10-week civil trial that ended in the spring, Scheindlin ruled that police officers violated the civil rights of tens of thousands of people by wrongly targeting black and Hispanic men with the stop-and-frisk program.

She appointed an outside monitor to oversee major changes, including reforms in policies, training and supervision, and she ordered a pilot program to test body-worn cameras.

The city did not immediately comment on the appeals court’s decision.

Stop-and-frisk, which has been criticized by civil rights advocates, has been around for decades, but recorded stops increased dramatically under Bloomberg’s administration.