Authorities in Switzerland have decided not to extradite film director Roman Polanski to the US to face sentencing for a case dating back to 1977.
Polanski, aged 76, has been under house arrest in his Swiss chalet since December 2009 pending the decision.
The filmmaker is wanted in California over a conviction for unlawful sex with a 13-year-old girl.
The US was "deeply disappointed" with the decision, a senior justice department official said.
Los Angeles District Attorney Steve Cooley's office, which had sought to have Polanski returned to Los Angeles, was also expected to issue a formal statement shortly.
After the Swiss ruling, Polanski paid "massive thanks" to his supporters.
"I simply want, from the bottom of my heart, to thank all those who supported me and tell them today of my great satisfaction," the Polish-born French filmmaker said in a statement released to the AFP news agency by his lawyer Herve Temime.
Polanski also reportedly left his luxurious Alpine chalet in the resort of Gstaad for an unknown destination.
Earlier on Monday, Swiss Justice Minister Eveline Widmer-Schlumpf said "the measures taken to restrict the freedom of Mr Polanski have already been lifted, the electronic tag has been removed".
The justice ministry said that the US authorities had failed to provide confidential testimony about Polanski's original sentencing procedure.
"The reason for the decision lies in the fact that it was not possible to exclude with the necessary certainty a fault in the US extraditionary request."
Polanski was originally charged with six offences including rape and sodomy over the 1977 case.
In 1978, he pleaded guilty to unlawful sex following a plea bargain. He served 42 days in a US prison.
He has always maintained he was promised a short sentence, but he fled the US after hearing rumours that the judge was about to re-sentence him for a much longer term. He has never returned to the US.
On Monday, the Swiss said that the US authorities simply had not clarified the issue of length of sentence and therefore had not made a convincing case for extradition.
The justice ministry added that that national interests were taken into consideration in the decision.
A Swiss official said the US cannot appeal the decision.
Polanski was taken into custody in Switzerland in September last year as he travelled from France to collect a lifetime achievement award at the Zurich Film Festival.
Polanski, whose films include Rosemary's Baby and The Pianist, was moved from prison and placed under house arrest at Gstaad in early December.
Polanski's wife, French actress Emmanuelle Seigner, said she was overjoyed at the decision.
She said: "It is with great pleasure that I have just learned of my husband's release. For me and for my children it is the end of a nightmare that has lasted more than nine months.
"I am really looking forward to being able to make plans and to once again have a normal family life, especially with my children, who did not deserve this suffering," she added in a statement.
Polanski's release was also welcomed by French politicians and artists.
"The great Franco-Polish director will from now on be able to rejoin his friends and family and work fully on his artistic projects," French Foreign Minister Bernard Kouchner said.
The Polish foreign ministry also welcomed the Swiss decision.