Harvey Weinstein arrived in a Manhattan courtroom on Thursday morning hoping a state judge would throw out the remaining criminal charges against him. Several Hollywood actresses sat in the gallery, hoping for the opposite outcome.

The last time Mr. Weinstein had appeared in court the same judge, James Burke, had dismissed part of the indictment against him after it was revealed that a police detective on the case had withheld crucial evidence from prosecutors.

Since then, Mr. Weinstein’s lawyer, Benjamin Brafman, had filed a new motion asking Justice Burke to throw out the remaining sexual assault charges because prosecutors did not share “highly exculpatory evidence” with the grand jury, including correspondence suggesting the women had remained on friendly terms with Mr. Weinstein after the alleged attacks. He argued “police and prosecutorial misconduct” had tainted the grand-jury’s decision-making.

But Justice Burke swept into State Supreme Court at 9:30 a.m. and immediately announced that he would not throw out the remaining counts against the once powerful producer. His decision paved the way for Mr. Weinstein to face trial next year on charges that he raped one woman and forced another to allow him to perform oral sex on her. Justice Burke later released a written opinion.

“The court’s review of the grand jury minutes shows that the presentation was legally and procedurally proper and that the people presented evidence in a fair manner,” Justice Burke wrote.

The Manhattan district attorney’s office had not presented a misleading account of the relationship between the two women and Mr. Weinstein as Mr. Brafman had claimed, Judge Burke wrote. He also noted that prosecutors were not required to present all the evidence favorable to Mr. Weinstein to the grand jury. There was no evidence, he wrote, that prosecutors had acted improperly.

Before the hearing was adjourned, defense lawyers and prosecutors huddled at Justice Burke’s bench for a 10-minute sidebar discussion out of earshot of the public. Mr. Weinstein, 66, sat at the defense table as actresses who had gathered as a show of support for the continuing prosecution — Kathy Najimy, Marisa Tomei, Jennifer Esposito, Michelle Hurd and Amber Tamblyn — looked on.

The judge also denied Mr. Weinstein’s request for an evidentiary hearing on allegations of police misconduct, and said that his defense lawyers could address the question of the witnesses’ credibility during the trial.

Standing on the steps of the Manhattan Criminal Courts Building before a phalanx of reporters, Mr. Brafman said he was disappointed by the judge’s decision. “We remain confident, despite the court’s ruling today, that ultimately at a trial of this case Mr. Weinstein will be completely exonerated,” Mr. Brafman said.

The district attorney’s office declined to comment. Mr. Weinstein is due back in court on March 7.

Mr. Weinstein was initially indicted on sex-crime charges involving three women, including one who said that the producer raped her in 2013 at a Midtown Manhattan hotel. The woman has not been identified in court papers. He was also charged with forcing two other women to engage in oral sex with him. Lucia Evans, a marketing executive, said she was assaulted in his TriBeCa office in 2004, and Mimi Haleyi, a production assistant, said Mr. Weinstein assaulted her at his apartment in 2006.

Mr. Weinstein has denied the allegations and has said the relationships were consensual.

Justice Burke dismissed the charge related to Ms. Evans after the Manhattan district attorney’s office acknowledged that Nicholas DiGaudio, the lead detective on the case, did not disclose information from a witness who said Ms. Evans had given her a conflicting account of the episode. But Detective DiGaudio, who has since been reassigned, has maintained that he did inform prosecutors.

Justice Burke said in his order on Thursday that the dismissal of the one charge “did not infect the integrity of the other charges,” and that there was “sufficient evidence” to support the remaining counts.

Speaking to reporters after the hearing, Gloria Allred, a lawyer who represents Ms. Haleyi, said she disagreed with reports that suggested the case against Mr. Weinstein was crumbling.

“There’s only one person on trial,” she said, “not the district attorney, not the police, it’s Harvey Weinstein. All the money poured into this case by the defense, and time and effort, did not succeed in helping Mr. Weinstein avoid facing a trial, avoid facing his accusers.”

Ms. Allred said outwardly friendly contact with an attacker after an assault does not mean that a crime did not occur. She noted similar evidence had been presented at the trial of the actor Bill Cosby on charges that he sexually assaulted Andrea Constand, but ultimately a jury convicted him.

Standing on the courthouse steps with the actresses, Lisa Borders, president of Time’s Up, a legal advocacy group for women facing sexual harassment in the workplace, said the group was “relieved that Harvey Weinstein failed in his efforts to avoid accountability in his actions.”

Ms. Borders said, “Today here in New York we saw the first steps toward justice.”