Mr Assange believes that if he is sent to Sweden he could eventually be passed to the United States, which has mulled legal action against him for publication of confidential files on the wars in Iraq and Afghanistan.

Ecuador foreign minister Ricardo Patino said the country had decided to grant political asylum to Mr Assange following a request sent to president Rafael Correa.

"We believe that his fears are legitimate and there are threats that he could face political persecution," Mr Patino told reporters in Quito.

"The Ecuador government, loyal to its tradition to protect those who seek refuge with us at our diplomatic missions, has decided to grant diplomatic asylum to Mr Assange.

"This is a sovereign decision protected by international law. It makes no sense to surmise that this implies a breaking of relations (with Britain)."

We believe that his fears are legitimate and there are threats that he could face political persecution

Ecuador's foreign minister Ricardo Patino

Shortly after the announcement, Mr Assange addressed staff at the embassy in London.

London's Metropolitan Police said three protesters had been arrested outside the embassy in the hours leading up to Ecuador's decision.

Protesters had chanted "Hands off Ecuador!" and blared rock music over a sound system, while banners reading "Free Assange" and "Protect whistleblowers" hung from barricades put up by police to contain them.

Vaughan Smith, who allowed Mr Assange to stay at his English mansion for over a year, welcomed the announcement that Mr Assange had been granted asylum.

"Julian Assange's fears are that the powerful forces he has enraged will eventually hunt him down and take away his liberty or his life," he said.

"There are questions, I think most people would agree that were Julian Assange to be taken to America now, his life and liberty would be at risk."

Greens Senator Scott Ludlam said Mr Assange had been forced to seek asylum because the Federal Government had not given him enough protection and support.

"I've been banging my head against this wall for the last eight months now trying to get a succession of foreign ministers to take even a faint spark of interest in what's really happening here," Senator Ludlam said.

"What the Ecuadorian government has done here, in effect, is offer Julian Assange the protection the Australian Government has failed to do."