Image copyright AP Image caption Julian Assange's Wikileaks website published leaked diplomatic cables

Ecuador has granted asylum to Wikileaks founder Julian Assange two months after he took refuge in its London embassy while fighting extradition from the UK.

It said his human rights might be violated if he is sent to Sweden to be questioned over sex assault claims.

Foreign Secretary William Hague said the UK would not allow Mr Assange safe passage out of the country and the move was also criticised by Stockholm.

Ecuador said it would seek to negotiate arrangements for Mr Assange to leave.

"We don't think it is reasonable that, after a sovereign government has made the decision of granting political asylum, a citizen is forced to live in an embassy for a long period," Foreign Minister Ricardo Patino said.

Mr Assange took refuge at the embassy in June to avoid extradition to Sweden, where he faces questioning over assault and rape claims, which he denies.

Mr Patino had accused the UK of making an "open threat" to enter its embassy to arrest Mr Assange, an Australian national.

Media playback is unsupported on your device Media caption Ecuador's foreign minister Ricardo Patino: "We believe that his fears are legitimate"

Mr Assange said being granted political asylum by Ecuador was a "significant victory" and thanked staff in the Ecuadorean embassy in London.

However, as the Foreign Office insisted the decision would not affect the UK's legal obligation to extradite him to Sweden, Mr Assange warned: "Things will get more stressful now."

"It was not Britain or my home country, Australia, that stood up to protect me from persecution, but a courageous, independent Latin American nation," said Mr Assange, who watched the announcement with embassy staff in a live link to a press conference in Quito.

"While today is a historic victory, our struggles have just begun. The unprecedented US investigation against Wikileaks must be stopped.

Analysis Political asylum is not available to anyone facing a serious non-political crime - such as the allegations levelled against Mr Assange. But does his new status mean he can now leave his Swedish problems behind? No. Asylum does not equal immunity from prosecution - and Julian Assange needs safe passage through UK territory that he won't get. Mr Assange knows he can't leave without risking arrest by officers waiting outside. The police can't enter the embassy unless the government revokes its status. Embassy vehicles are protected by law from police searches - but how could he get into an Ecuadorean car without being apprehended? And what happens after he's in the car? At some point he will have to get out again. Stranger things have happened. In 1984 there was an attempt to smuggle a Nigerian man from the UK in a so-called "diplomatic bag" protected from inspection. The bag was in fact a large crate - and customs officers successfully intercepted it at the airport.

"While today much of the focus will be on the decision of the Ecuadorean government, it is just as important that we remember Bradley Manning has been detained without trial for over 800 days," he said, referring to the former US soldier accused of leaking government material to Wikileaks.

Mr Assange is expected to make a statement in front of the embassy on Sunday at 14:00 BST, according to the Wikileaks Twitter feed.

'Legal obligation'

Announcing Ecuador's decision, Mr Patino launched a strong attack on the UK for what he said was an "explicit type of blackmail".

The UK Foreign Office had warned, in a note, that it could lift the embassy's diplomatic status to fulfil a "legal obligation" to extradite the 41-year-old by using the Diplomatic and Consular Premises Act 1987.

That allows the UK to revoke the diplomatic status of an embassy on UK soil, which would potentially allow police to enter the building to arrest Mr Assange for breaching the terms of his bail.

Mr Hague said it was a "matter of regret" that the Ecuadorean government decided to grant Mr Assange political asylum but warned that it "does not change the fundamentals" of the case.

He also warned that it could drag on for some "considerable" time.

"We will not allow Mr Assange safe passage out of the United Kingdom, nor is there any legal basis for us to do so," he said.

Media playback is unsupported on your device Media caption Scuffles broke out outside the Ecuadorean embassy

Mr Hague said there was "no threat" to storm the embassy.

"We are talking about an Act of Parliament in this country which stresses that it must be used in full conformity with international law," he said.

Mr Patino said Ecuador believed Mr Assange's fears of political persecution were "legitimate" and said his country was being loyal to its tradition of protecting those who were vulnerable.

He later told BBC Mundo that conditions were attached to the asylum.

"We placed the same type of conditions that are the norm in international relations, such as him [Mr Assange] not making political statements that could affect our relations with friendly countries."

The Foreign Office said it was "disappointed" by the Ecuador statement and said it remained committed to reaching a "negotiated solution" that would allow it to carry out its "obligations under the Extradition Act". This means Mr Assange's arrest would still be sought if he left the embassy.

Sweden summons ambassador

The Swedish government reacted angrily to Mr Patino's suggestion that Mr Assange would not be treated fairly by its justice system, summoning Ecuador's ambassador to explain.

At the scene Julian Assange's small, but vocal, band of supporters chanted loudly and marched along the street in front of the Ecuadorean Embassy when the news filtered through from Quito. They, like the man they have come here to support, regard Ecuador's decision as a significant victory against the UK, US and Sweden, all of which they claim are trying to silence Mr Assange. But Mr Assange's supporters also know there's little chance of the man they regard as a hero of free speech making a public appearance on the pavement opposite the world-famous green awnings of the Harrods department store. He would very likely be arrested if he stepped outside the Ecuadorean Embassy, where he is - for the moment at least - still protected by the diplomatic immunity granted to foreign government buildings on UK soil. Mr Assange is locked in a diplomatic and political stalemate. Ecuador may have granted him asylum, but he still has nowhere to go.

"The accusations... are serious, and it is unacceptable that Ecuador would want to halt the Swedish judicial process and European judicial co-operation," said Anders Joerle, spokesman for the Swedish foreign ministry.

The Organisation of American States called a special meeting at its Washington headquarters on Thursday to discuss the Ecuador-UK relationship, specifically Ecuador's diplomatic premises in the UK.

The Union of South American Nations, meanwhile, has convened an "extraordinary meeting" in Ecuador on Sunday to consider "the situation raised at the embassy".

Mr Assange entered the embassy after the UK's Supreme Court dismissed his bid to reopen his appeal against extradition and gave him a two-week grace period before extradition proceedings could start.

It was during that fortnight, while on bail, that he sought refuge.

A subsequent offer by Ecuador to allow Swedish investigators to interview Mr Assange inside the embassy was rejected.

The Wikileaks website Mr Assange founded published a mass of leaked diplomatic cables that embarrassed several governments, particularly that of the US, in 2010.

Mr Assange says he fears that if extradited to Sweden, he will then be passed on to the American authorities.

In 2010, two female Wikileaks supporters accused Mr Assange of committing sexual offences against them while he was in Stockholm to give a lecture.

Mr Assange claims the sex was consensual and the allegations are politically motivated.