Marianne Ny said his arrest warrant was being revoked as it was impossible to serve him notice of his alleged crimes.
Mr Assange, 45, has lived in the Ecuadorean embassy in London since 2012, fearing extradition to Sweden would lead to extradition to the US.
Police in London said they would still be obliged to arrest him if he left.
The Metropolitan Police Service (MPS) said Mr Assange still faced the lesser charge of failing to surrender to a court, an offence punishable by up to a year in prison or a fine.
Mr Assange’s Swedish lawyer, Per Samuelson, said the prosecutor’s decision on Friday represented “a total victory” for his client.
The plaintiff in the rape case was “shocked” by the decision, her lawyer said, and maintained her accusations against Mr Assange, Agence France-Presse reported.
At a press briefing on Friday, Ms Ny said that by remaining in the embassy in London Mr Assange had evaded the exercise of the European Arrest Warrant (EAW) that would have seen him extradited to Sweden.