Poland’s Supreme Court has upheld a refusal to have film-maker Roman Polanski extradited to the US if he enters Poland.

Polanski is wanted in the US over a case involving sex with a minor, which has haunted him for almost 40 years. He lives in France and has a home in Switzerland, but has often visited Poland, where he grew up.

The three-judge panel rejected on Tuesday a request made by justice minister Zbigniew Ziobro to overturn the extradition refusal; it upheld the procedure and decision taken by a lower court. The ruling closes the case.

Polanski wanted to make a film in Poland last year, but cancelled his plans after Ziobro’s move. The justice minister revived the case in May, months after the conservative government took office. Ziobro argued that Polanski should be punished and that his celebrity status was the only thing shielding the Oscar-winning director from being extradited.

The lower court had argued Polanski, 83, had served a prison term, and that he would probably not get a fair trial in the US if he was extradited.

The director pleaded guilty in 1977 to one count of unlawful sexual intercourse with a 13-year-old girl during a photo shoot in Los Angeles. In a deal with the US judge, he served 42 days in prison, but then fled America fearing that the judge might impose a much longer term.