QUITO (AFP) - Ecuador granted political asylum to WikiLeaks founder Julian Assange on Thursday, setting up a diplomatic confrontation with Britain, which angrily insisted it would extradite him to Sweden.

Ecuadoran Foreign Minister Ricardo Patino argued the Australian activist would not get a fair trial if he is eventually sent to the United States to be tried for illegally publishing a trove of classified documents.

“The Ecuador government, loyal to its tradition of protecting those who seek refuge with us at our diplomatic missions, has decided to grant diplomatic asylum to Mr Assange,” Patino said, at a news conference.

The decision escalated a crisis set in motion when Assange, 41, took refuge in the Ecuadoran embassy in London on June 19 to avoid extradition to Sweden, where he is wanted for questioning in a sexual assault case.

Britain insisted it would carry out its “obligation” to extradite Assange regardless of the Ecuadoran decision and Sweden immediately rejected Patino’s argument that Assange would not be treated fairly. “Nobody is going to scare us,” Ecuador’s President Rafael Correa said on his Twitter account, minutes before the decision was announced.

Patino said his government reached its decision after Britain, Sweden and the United States refused to provide guarantees that Assange would not be extradited to the United States. In 2010, WikiLeaks obtained and published online an enormous cache of US military documents on the war in Iraq and Afghanistan and diplomatic cables that deeply embarrassed the United States.

A US army private, Bradley Manning, faces trial in the US military courts later this year for allegedly passing the classified material to WikiLeaks.

“If he were extradited to the United States, Mr Assange would not receive a fair trial and could be judged by special tribunals or military courts,” Patino said. “It is not implausible that he would be subjected to cruel and degrading treatment and be condemned to life in prison or capital punishment.”

Patino said Assange’s imprisonment in Sweden “would open up a chain of events that would impede his avoiding extradition to a third country.” “As a result, Ecuador feels his arguments mean his fears are genuine, that he could be the victim of political persecution because of his decisive defense of the freedom of expression and the freedom of the press,” he said. Patino said that if Britain did not grant Assange safe conduct out of the country, he would remain “under the protection of our embassy.”

He said the Ecuadoran action should not lead to a rupture in relations between the two countries, calling it “a sovereign decision protected by international law.” But the British Foreign Office expressed disappointment and said the Ecuadoran decision changed nothing.

“Under our law, with Mr Assange having exhausted all options of appeal, the British authorities are under a binding obligation to extradite him to Sweden. We shall carry out that obligation,” a Foreign Office spokeswoman said.

The spokeswoman added: “We remain committed to a negotiated solution that allows us to carry out our obligations under the Extradition Act.”

Swedish Foreign Minister Carl Bildt took to his Twitter account to respond.

“Our firm legal and constitutional system guarantees the rights of each and everyone. We firmly reject any accusations to the contrary,” he said.

Outside the Ecuadoran embassy in London’s exclusive Knightsbridge district, police arrested three protesters and put up barricades to keep back a crowd of about 30 Assange supporters chanting “Hands off Ecuador!”

More than a dozen police wearing stab-proof vests were on guard outside the block of flats that houses the embassy, ready to arrest Assange if he tries to leave.

Patino said Wednesday that Ecuador had received “an express threat in writing” from Britain “that they could storm our embassy if Ecuador does not hand over Julian Assange.”

“Ecuador rejects in the strongest terms the explicit threat made in Britain’s official communication,” Patino said warning that raiding an embassy “would be a flagrant violation of the Vienna Convention.

Britain’s Foreign Office has argued it could invoke the Diplomatic and Consular Premises Act of 1987, which it says allows it to revoke the diplomatic immunity of an embassy on British soil.