LOS ANGELES (AP) -- A judge has refused to dismiss a 31-year-old sex case against Roman Polanski because he's a fugitive but signaled that he would reconsider if the film director returns to the United States and appears in court.

Superior Court Judge Peter Espinoza said Tuesday that after watching a documentary on the case he agrees there was misconduct by the now-deceased judge who arranged a plea bargain but reneged on it.

Polanski, now 75, pleaded guilty in 1977 to unlawful sexual intercourse with a 13-year-old girl but fled to France in February 1978 after the judge threatened him with more prison time than agreed upon. That judge also said Polanski would have to voluntarily deport himself.

"Having reviewed all the evidence in this case, there was substantial misconduct that occurred in the pendency of this case," said Espinoza. But he said that if Polanski wants a ruling on that underlying issue, "He just needs to submit to the jurisdiction of this court."

Espinoza stayed his own decision until May 7 and ordered attorneys to appear in court then.

"If you are anticipating Mr. Polanski's presence on that date, I would need notice to arrange for security," Espinoza told Polanski's lawyer, Chad Hummel. He noted the large turnout of news media at Tuesday's hearing, even though it had been known that Polanski would not be there.

Hummel asked the judge for "guidance on what would happen if he returns." He did not get it.

The judge said he was relying on the fugitive disentitlement doctrine, which says that fugitives are not entitled to the processes of the court. In addition, he cited the more than 30-year delay since Polanski fled.

Loyola University law professor Laurie Levenson, who attended the hearing as an observer, said the ruling was anticipated but the judge's willingness to reconsider was a surprise.

"Without committing himself, the judge said, if you show up it may not be as bad as you think.... The ray of light for Polanski is that the judge says there was misconduct," Levenson said.

Deputy District Attorney David Wolgren told Espinoza he disputes the misconduct allegations and said it would be a miscarriage of justice to allow Polanski to seek dismissal of his case "from the comforts of France."

Polanski lives in France, where his film career has continued to flourish. He received a directing Oscar in absentia for the 2002 movie "The Pianist." While still working in the United States, he directed such classic films as "Chinatown" and "Rosemary's Baby."

If he chose to return to the U.S., he likely would be arrested on a fugitive warrant. He has said he has no plans to ever set foot in the U.S. again.

Espinoza said he reviewed not only legal documents filed by both sides but also watched the HBO documentary, "Roman Polanski: Wanted and Desired," which uncovered new information about actions by the late Judge Laurence J. Rittenband.

The documentary suggests behind-the-scenes manipulations by a now-retired prosecutor who was not assigned to the case prodded the judge to renege on his plea agreement. By then, Polanski had spent 42 days in prison in what his lawyers believed was his full sentence under a plea bargain. Rittenband's decision to add more prison time and require his voluntary deportation prompted him to leave the country.

Lawrence Silver, a lawyer representing the victim, now a 45-year-old woman, argued for dismissal.

"The time has come for this case to end, your honor," he said.

In another twist on the unusual case, Douglas Dalton, the attorney who represented Polanski in the original case, gave an impassioned argument in which he claimed that Polanski was the victim of "a fugitive Catch-22."

"Judge Rittenband wanted him out of the country and wanted him never to return. And that's what Polanski did," he said. "And now he can't get any relief because he's out of the country. It's the classic Catch-22."

Marina Zenovich, the filmmaker whose documentary focused new attention on the case, was in court with a camera crew.