A Polish court has rejected a request to extradite film director Roman Polanski to the US for having sex with a 13-year-old girl in the 1970s.
Judge Dariusz Mazur said the request was "inadmissible". However prosecutors can still appeal against the ruling.
The 82-year-old Oscar-winning director was not present for Friday's court session in Krakow.
Polanski, who admitted unlawful sex with a minor, fled the US ahead of sentencing in 1978.
After the ruling, Polanski said he was "very happy" the case was coming to a close.
"I feel relieved but tired... it cost me a lot of energy, a lot of time," he told reporters in Krakow.
Polanski has French and Polish citizenship. He lives in France - which does not extradite its own citizens - but has been working in Poland on a film project.
Swiss authorities turned down a US extradition warrant in 2010, after placing Polanski under house arrest for nine months.
The film director's Polish lawyers had argued against his extradition, citing claimed legal flaws in the US process and the 42 days Polanski served in prison at the time, according to the Associated Press news agency.
Polanski grew up in Poland and is regarded as one of the country's greatest living artists.
He survived World War Two in the Krakow ghetto but his mother died at Auschwitz.
Polish voters elected a conservative government at the weekend - and officials from the Law and Justice party had said Polanski should be sent to America to face justice.
If a Polish court were to rule in favour of extradition, the final decision would rest with the justice secretary.