A major European Union agency currently based in Tower Hamlets is fighting a High Court battle against Canary Wharf in a bid to use Brexit to get out of an estimated £500 million bill.

The European Medicines Agency (EMA) argues that its 25-year lease has been “frustrated” by the UK’s imminent departure from the EU, meaning it should not have to comply with the terms of the lease after Brexit.

But Canary Wharf has taken the agency to court to enforce it, saying that “however ‘hard’ or ‘soft’ Brexit may be, it is not sufficient to frustrate the lease”.

At the start of a six-day hearing today, Canary Wharf’s barrister, Joanne Wicks QC, said that “if the EMA were to succeed in this claim, other tenants might be tempted to follow suit, with significant consequences for the property market”.

Ms Wicks told Mr Justice Marcus Smith that the question for the court was “whether the UK’s departure from the EU is an event which so fundamentally and radically changes the nature of the EMA’s 25-year lease that it is released from its obligations under it”.

She submitted that “Brexit is worlds away from the type of event that may be capable of frustrating a long lease”.

The EMA, which is responsible for the evalutation and monitoring of all medicines across the EU, has been based in London since its formation in 1993, but is due to relocate to Amsterdam after Brexit.

The agency argues that it is under a “legal obligation” to leave London for Amsterdam, meaning it “faces paying ‘double rent’ for 21 years” until its lease expires in 2039, which it says would be “hugely unfair”.

But Ms Wicks argued that “Brexit was foreseeable as a real possibility” when the lease was agreed in 2011, which was “a significant factor against frustration” being proved.

In written submissions, Jonathan Seitler QC, for the EMA, argued that it was “necessary to ‘vindicate justice’ to release the EMA from its onerous obligations so that the parties can - like the UK and the EU - go their separate ways as amicably as possible”.

He added: “To hold the EMA to the lease for the next 21 years would, in the quite exceptional circumstances of this case, produce very substantial injustice.”

Mr Seitler said that “had Brexit been foreseen, the 2011 agreements (to take the 25-year lease) would not have been entered into”.

Mr Justice Marcus Smith is expected to reserve his judgment.