The latest twist in the Julian Assange case, as we await Ecuador's decision on granting him asylum (a decision which would not, as I've written before, in itself allow protection from arrest if he steps outside the embassy), is that people are wondering whether the UK can simply strip the embassy of its diplomatic status, so allowing police officers to enter it.

It seems the British embassy in Quito has written to the Ecuadorian government (hat tip to @JasonLeopold) saying:

"You need to be aware that there is a legal base in the UK, the Diplomatic and Consular Premises Act 1987, that would allow us to take actions in order to arrest Mr Assange in the current premises of the embassy. "We sincerely hope that we do not reach that point, but if you are not capable of resolving this matter of Mr Assange's presence in your premises, this is an open option for us."

The 1987 Act does indeed give ministers a power to withdraw recognition from diplomatic premises. Section 1(3) says:

"In no case is land to be regarded as a state's diplomatic or consular premises for the purposes of any enactment or rule of law unless it has been so accepted or the secretary of state has given that state consent under this section in relation to it; and if —

(a) a state ceases to use land for the purposes of its mission or exclusively for the purposes of a consular post; or

(b) the secretary of state withdraws his acceptance or consent in relation to land,

it thereupon ceases to be diplomatic or consular premises for the purposes of all enactments and rules of law."

On the face of it, then, the secretary of state (in practice a foreign office minister) could now simply withdraw consent, and with one bound, police would be free to make an arrest.

But it's not quite as simple as that. You'll note that section 1(4) says

"The secretary of state shall only give or withdraw consent or withdraw acceptance if he is satisfied that to do so is permissible under international law,"

and that according to section 1(5), in deciding whether to withdraw consent, the minister:

" … shall have regard to all material considerations, and in particular, but without prejudice to the generality of this subsection —

(a) to the safety of the public;

(b) to national security; and

(c) to town and country planning."

The "compliance with international law" requirement may present a problem, since article 21 of the Vienna Convention on Diplomatic Relations requires the UK to facilitate the acquisition by Ecuador of premises necessary for its mission, or assist it in obtaining accommodation. It's not obvious this allows the UK to just de-recognise the current premises without helping arrange something new.

Section 1(5) is interesting because, in spite of the way the drafting clearly intends to preserve ministers' ability to take account of anything they think relevant, I've no doubt lawyers for Ecuador could argue that the list of three particular concerns colours the scope of ministers' considerations, the result being that only some particular difficulty relating to safety or to the premises themselves could justify withdrawal.

More importantly, they could argue that Assange's presence in the embassy and Ecuador's conduct in sheltering him is not a material consideration; and that since that clearly lay behind the withdrawal, ministers would in deciding to withdraw consent, have taken into account an irrelevant factor.

In addition, there'd be a potentially strong argument to be made that ministers had exercised their power for an improper purpose not intended by parliament when it enacted the 1987 legislation – their desire to arrest Julian Assange.

Ecuador could judicially review any proposed withdrawal: I think the effect on Assange means this is the type of case in which, as Lord Sumption explained in a recent speech, the courts would consider intervening in a foreign policy decision. Perhaps Assange could obtain an injunction on judicial review, preventing any arrest pending the outcome of proceedings. Of course, if the government successfully fought off that judicial review, the arrest could go ahead. But I don't think a defence would be easy, and at the very least, a judicial review would create further delay – which probably suits Assange fairly well. I'm not sure giving him a hook to hang one on would be the best tactical move for the government.

The Quito letter from the UK to Ecuador went on apparently to say:

"We need to reiterate that we consider the continued use of the diplomatic premises in this way incompatible with the Vienna Convention and unsustainable and we have made clear the serious implications that this has for our diplomatic relations."

If I were advising the government, I think I'd say that, if ministers are determined to allow the arrest of Assange, it might be better simply to cut off diplomatic relations with Ecuador, send the ambassador home, close the embassy and arrest Assange after that. Ending diplomatic relations is the major sort of foreign affairs decision I doubt the courts would interfere with. But that'd be a major diplomatic call.

• This piece first appeared on Carl Gardner's blog, Head of Legal. Republished here with permission.