Friday's announcement means Assange is no longer under any investigation in Sweden.
The decision was made by Sweden's director of public prosecution, who confirmed that she chose to discontinue the investigation against the WikiLeaks co-founder.
Earlier on Friday Swedish Chief Prosecutor Marianne Ny said the rape investigation could not proceed due to legal obstacles.
Sweden is dropping its investigation into WikiLeaks founder Julian Assange on rape allegations, according to a prosecution statement released Friday.
The 45-year-old has lived in the Ecuadorian embassy in London since 2012 to avoid facing charges in Sweden.
The Justice Department investigation of Assange and WikiLeaks dates to at least 2010, when the site first gained wide attention for posting thousands of files stolen by the former US Army intelligence analyst now known as Chelsea Manning.
Prosecutors said the preliminary rape and sexual assault probe has been discontinued and an arrest warrant issued for Mr Assange would be revoked, sparking speculation he would be leaving the Ecuadorian Embassy in London.
A lawyer for Assange welcomed the decision of prosecutors to drop the seven-year rape investigation against him, saying it was the "end of his nightmare".
Assange is still inside the Ecuadorean Embassy in London where he has lived for almost five years.
Asked if she would support Britain extraditing Assange to the United States, she said: "We look at extradition requests when we receive them on a case-by-case basis".
Assange's lawyer, Per E Samuelsson, told Swedish Radio the decision was "a total victory" for his client. He is of course happy and relieved.
Police kept up round-the-clock guard outside the embassy until December 2015, when the operation was scaled back, in part because of the cost, which had exceeded 11 million pounds (over $17.5 million at the time).