A POLISH court has ruled that the law forbids Roman Polanski's extradition to the US where he pleaded guilty nearly four decades ago to having sex with a minor.

A judge in the southern city of Krakow heard from lawyers for Polanski and the US, which requested the extradition earlier this year.

Polanski's lawyers argued that the US request had legal flaws and said the film-maker had already served a prison term under a deal with a Los Angeles judge.

The decision could close the case in Polanski's favour if the US does not appeal.

But an appeal - if successful - could make an extradition likely, because the new Law and Justice party government to be installed in November has indicated there will be no leniency for Polanski, 83, as it makes a point of applying laws strictly and equally to all.

Judge Dariusz Mazur said the case is very complicated but an extradition procedure would violate the human rights of Polanski because he could be subject to confinement

"This is not about justice or the interest of the victim," lawyer Jan Olszewski said.

The director pleaded guilty in 1977 to one count of statutory rape for having sex with a 13-year-old girl during a photo shoot in Los Angeles. He was ordered to undergo a psychiatric study at a state prison, where he served 42 days.

The Oscar-winning director was in Krakow for the hearing but did not appear in court.

His lawyers have said they understood from a private conversation with the judge in the LA case that the time in prison would be Polanski's punishment, but they said the judge later suggested Polanski would go back to prison, at which point he fled to France.

The Polish court's verdict is subject to appeal within seven days

Polanski is a celebrity in Poland and public opinion in his childhood country has been mostly in his favour. He won an Academy Award for best director for his 2002 film The Pianist and was nominated for 1974's Chinatown and 1979's Tess.

His movements are restricted by an Interpol warrant in effect in 188 countries, but he is avoiding extradition by remaining only in France, Poland and Switzerland.

Polanski said he was "very happy that this case is coming to a close. I can breathe now with relief".

At a press conference in Krakow, he added: "I pleaded guilty. I went to prison. I have done my penalty. The case is closed."

He said the case "has cost me a lot of effort, a lot of trouble, a lot of health. And it cost my family even more".