Assange, 45, took refuge in the embassy in June 2012 to avoid extradition to Sweden after two women made rape and sexual molestation allegations against him, which he denies.
He feared Sweden would hand him over to the United States to face prosecution over WikiLeaks' publication of swathes of classified military and diplomatic documents in one of the largest information leaks in U.S. history.
Assange tweeted on Friday that he would not forgive those behind the investigation: "Detained for 7 years without charge while my children grew up and my name was slandered. I do not forgive or forget."
Earlier Swedish Chief Prosecutor Marianne Ny said the rape investigation could not proceed because of legal obstacles.
"We are not making a statement about his guilt," Ny said, adding that the investigation could be reopened if Assange came to Sweden before the statute of limitations deadline for the rape allegation in 2020.
However, police in London said they were still obliged to arrest Assange if he left the embassy for skipping bail. They said this was a much less serious offence than rape, but he could still face up to a year in jail if convicted.
Assange is a cyber hero to some for exposing government abuses of power and championing free speech, but to others he is a criminal who has undermined the security of the West.
The former computer hacker enraged Washington by publishing hundreds of thousands of secret U.S. diplomatic cables that laid bare often highly critical U.S. appraisals of world leaders from Russian President Vladimir Putin to the Saudi royal family.
He always denied the rape allegations in Sweden and said they were a ploy to get him whisked off to the United States.
WANTED BY WASHINGTON
In January, Assange said he stood by an offer to go to the United States providing his rights were upheld and if former military intelligence analyst Chelsea Manning, who was responsible for a 2010 leak of classified materials to Assange's anti-secrecy group, were freed.
Manning was released on Wednesday after spending seven years in a U.S. military prison for passing the documents to WikiLeaks.
British Prime Minister Theresa May said on Friday it would be "an operational matter for the police" to decide whether to arrest Assange if he left the embassy.
Last month CIA Director Mike Pompeo called WikiLeaks a "hostile intelligence service", and Attorney General Jeff Sessions, responding to a question about Assange, said the administration was stepping up its efforts against all leaks of sensitive information.
"Whenever a case can be made, we will seek to put some people in jail," Sessions said.
During last year's U.S. presidential election campaign, WikiLeaks published emails from Hillary Clinton's staff and the Democratic National Committee which some believe helped to lose her the election. The mails were allegedly stolen by Russian hackers.
While Assange may still not be able to leave Ecuador's embassy in the upmarket Knightsbridge area of London, the prosecutor's decision to stop the investigation into allegations of rape brings to an end a seven-year stand-off with Sweden.
The case has raised questions about the Swedish justice system, with a United Nations panel saying Assange had been subject to "arbitrary detention".
Prosecutors have been accused of vacillating, first dropping the preliminary investigation and then re-opening it and of dragging their heels over questioning Assange.
Prosecutors first interviewed Assange in November last year in the Ecuadorian embassy. They were not allowed to question him directly but only through an Ecuadorean prosecutor.
Assange's lawyer Per Samuelson hailed Sweden's decision to drop the investigation as "a total victory for us".
"That's because we finally were able to get the interview done (with the Swedish side) and he could describe what really happened and also because we could show that the United States is hunting him, which we could not do before," Samuelson said.
(Additional reporting by Johannes Hellstrom,; Johan Ahlander, Niklas Pollard and Olof Swahnberg; Editing by Guy Faulconbridge and Gareth Jones)
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)