LONDON — The Swedish prosecutor announced Friday that the investigation into WikiLeaks founder Julian Assange for suspected rape has been discontinued.

Assange, who denied the allegation, has been holed up in the Ecuadorian Embassy in London since June 2012. He was granted diplomatic asylum in August that year.

He sought asylum at the embassy over fears that if he is extradited to Sweden he would be sent onward to the U.S. for prosecution over WikiLeaks’ publication of secret documents, including thousands of U.S. diplomatic cables.

Assange posted a picture of himself smiling broadly to his Twitter account soon after the announcement Friday.

He still faces arrest if he leaves the embassy building, police said.

In a statement, the London Metropolitan Police said: "Westminster Magistrates' Court issued a warrant for the arrest of Julian Assange following him failing to surrender to the court on the 29 June 2012. The Metropolitan Police Service is obliged to execute that warrant should he leave the Embassy.

"Now that the situation has changed and the Swedish authorities have discontinued their investigation into that matter, Mr Assange remains wanted for a much less serious offence."