Judge Peter Espinoza rejected a request by Polanski to be sentenced in his absence, and instead said the Oscar-winning director must return to California.
``I choose to insist that he appear,'' Espinoza said.
Polanski, 76, fled California in 1978 and was arrested in September in Switzerland. He is currently under house arrest in Gstaad fighting extradition to the United States.
Attorneys for Polanski said they plan to appeal the judge's decision, likely prolonging the decades-long battle now playing out in both Switzerland and Los Angeles to bring him to justice.
Polanski, whose movies included ``Chinatown'' and ``Rosemary's Baby,'' formally asked to be sentenced in his absence earlier this month, after a California appeals court suggested that might be one way of resolving the case.
The victim in the case supported his request, but Los Angeles prosecutors opposed the move.
They argued that Polanski should not be allowed to ''dictate'' his case from afar and should not be treated differently because he is a celebrity.
``This convicted felon, this child rapist, must surrender to the court,'' prosecutor David Walgren told the hearing Friday.
Polanski, who won an Oscar in 2003 for ``The Pianist,'' pleaded guilty to unlawful sex with a minor in 1977 but skipped bail and fled to France before being sentenced.
The French-Polish national later said he feared the judge would renege on a plea agreement limiting his punishment to the 42 days he had spent behind bars for psychiatric evaluation.
Polanski's lawyers vigorously opposed his extradition and sought to have the unlawful sex case dropped, alleging judicial misconduct more than 30 years ago.
They also argued that is why Polanski refuses to return.
``It pains me to say this ... he does not trust this system and this system has given him no reason to trust it,'' said Chad Hummel, one of Polanski's attorneys.
Hummel urged Espinoza to respect the original judge's promise of no more time in prison. The original judge, Laurence Rittenband, has since died.
Samantha Geimer, who accused Polanski of plying her with alcohol and drugs before raping and sodomising her, has sought a close to the case, and her lawyer made that argument again on Friday.
Polanski's arrest last year caused a furor in France, but industry reaction in Hollywood has been much cooler.
Keep up with the latest business news from the region with the Emirates Business 24|7 daily newsletter. To subscribe to the newsletter, please click here.