LONDON — WikiLeaks founder Julian Assange was granted asylum on Thursday by Ecuador, raising the possibility of a diplomatic showdown between British and Ecuadoran authorities.

The transparency campaigner has been holed up at the Embassy of Ecuador in London for nearly eight weeks after seeking refuge there in a bid to avoid extradition to Sweden, where he is wanted for questioning over alleged sex crimes.

Ecuador has announced it’s granting political asylum to Wikileaks founder Julian Assange, who’s been holed up in the country’s embassy in London since June. Assange faces extradition to Sweden, where he’s wanted on a sexual misconduct charge.

The British Foreign Office made it clear Thursday that Ecuador’s decision does not alter Britain’s intention of fulfilling its legal obligation to extradite Assange. “We shall carry out that obligation,” it said in a statement. “The Ecuadorian government’s decision this afternoon does not change that.”

At a news conference in Quito, Ecuador’s foreign minister, Ricardo Patino, said Ecuador had decided to grant asylum “because of the fears expressed by Mr. Assange, we believe that his fears are legitimate, and there are threats that he could face political persecution if the measures aren’t taken to avoid them.”

Patino said Ecuador failed to get guarantees from Britain, Sweden and the United States that Assange would not be extradited from Sweden to the United States. His supporters believe he could be tried for espionage in the United States over his whistle-blowing Web site’s release of hundreds of thousands of confidential military logs and diplomatic cables.