Media playback is unsupported on your device Media caption The BBC's Nick Childs: "The diplomatic temperature has been rising"

Ecuador has accused the UK of making a "threat" to enter its embassy in London to arrest Wikileaks' Julian Assange.

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.

Ecuador says a decision on his claim for political asylum will come later.

The UK Foreign Office says it can lift the embassy's diplomatic status to fulfil a "legal obligation" to extradite the 41-year-old.

In an official note to the Ecuadoreans it said it was "surprised" by media reports that "Ecuador is about to take a decision and proposes to grant asylum to Mr Assange".

The BBC's Tim Reid, outside the embassy, said Ecuador had accused the UK of "intimidating" behaviour and that it was "surprised and disappointed" by what had gone on.

In June, the UK's Supreme Court dismissed Mr Assange's 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.

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

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

Media playback is unsupported on your device Media caption Extradition expert Julian Knowles on the implications of any police raid on Ecuador's embassy

A number of police officers are outside the Ecuadorean embassy, in Knightsbridge, where some of Mr Assange's supporters have also gathered.

Three protesters have been arrested outside the embassy after minor scuffles.

The BBC's Stuart Hughes says some of the demonstrators have been chanting: "Julian Assange, freedom fighter."

Protests have also been held outside the British embassy in Ecuador's capital.

Images from Quito showed protesters holding signs saying: "We are sovereign, not colonies" and a union jack being stepped on.

'Improper' threat

At a news conference in Quito on Wednesday, Ecuador's Foreign Minister, Ricardo Patino, said a letter from the UK government had been delivered through a British embassy official.

"Today we received from the United Kingdom an express threat, in writing, that they might storm our embassy in London if we don't hand over Julian Assange," he said.

"Ecuador rejects in the most emphatic terms the explicit threat of the British official communication."

He said such a threat was "improper of a democratic, civilised and rule-abiding country".

He added: "If the measure announced in the British official communication is enacted, it will be interpreted by Ecuador as an unacceptable, unfriendly and hostile act and as an attempt against our sovereignty. It would force us to respond.

"We are not a British colony."

A Foreign Office spokesman said the UK remained "determined" to fulfil its obligation to extradite Mr Assange.

Analysis It was not a piece of news anyone thought would come from Ecuador - and the style of the announcement came as a great surprise. Ecuador's Foreign Minister Ricardo Patino was visibly angry as he lectured the UK government on its diplomatic obligations for several minutes. The British "threat" to enter its London embassy to capture Julian Assange, however, might accomplish the unthinkable and briefly unite Ecuador's political forces. Critics of President Rafael Correa have accused the government of not properly handling Mr Assange's case but have also deemed the UK position unacceptable. They also fear any violation of Ecuador's sovereignty would strengthen Mr Correa and could turn him into a hero. The question now is whether they will let him fight this battle on his own.

"Throughout this process we have drawn the Ecuadoreans' attention to relevant provisions of our law, whether, for example, the extensive human rights safeguards in our extradition procedures, or to the legal status of diplomatic premises in the UK," the spokesman said.

"We are still committed to reaching a mutually acceptable solution."

The law the UK has informed Ecuador it could use in the case is the Diplomatic and Consular Premises Act 1987.

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

The act was introduced after PC Yvonne Fletcher was shot outside the Libyan Embassy in London in 1984.

'Legal obligations'

The Foreign Office note to Ecuador stated: "We very much hope not to get this point [revoking diplomatic status], but if you cannot resolve the issue of Mr Assange's presence on your premises, this route is open to us."

It also said that it must meet its legal obligations to arrest Mr Assange and extradite him to Sweden.

The note went on: "We remain committed to working with you amicably to resolve this matter. But we must be absolutely clear this means that should we receive a request for safe passage for Mr Assange, after granting asylum, this would be refused, in line with our legal obligations."

The Ecuadorean foreign minister told reporters an announcement on Mr Assange's bid for political asylum would be issued on Thursday at 07:00 local time (13:00 BST).

The BBC's Bridget Kendall said she believed it was "quite likely" that Ecuador would grant Mr Assange asylum because it had reacted strongly to the UK and may not want to be perceived to be buckling under pressure.

However, he could still be arrested if he left the embassy, she said.

Image copyright Getty Images Image caption Supporters of Mr Assange have been gathering outside the embassy

Our correspondent could not recall a precedent in which the Diplomatic and Consular Premises Act 1987 had been used in this way.

And former government lawyer Carl Gardner told BBC Radio 4's Today programme legal advisers would be "urging the most extreme caution".

In 2010, two female Wikileaks supporters accused Mr Assange, an Australian citizen, 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.

In June, judges at the UK's Supreme Court dismissed his final appeal against extradition to Sweden.

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