French President Emmanuel Macron’s victory in France was greeted across Europe with an audible sigh of relief, and now many across the Continent are watching eagerly to see if he can carry out the reforms he promised on the campaign trail.

In the U.K., however, the outlook is at best mixed. On the one hand, there’s the sense of a bullet dodged with the defeat of Macron’s far-right opponent Marine Le Pen. On the other, there’s the fact that one of the young president’s pledges was to renegotiate the Treaty of Le Touquet, a bilateral border control agreement that has kept tens of thousands of migrants headed for Britain on the French side of the Channel.

Revisiting this treaty, which was signed in 2003, would be difficult even in times of political calm. In the context of Brexit negotiations, doing so would be explosive.

The agreement allows each country to install border controls on the other’s sovereign territory, preventing asylum seekers from reaching Britain and leaving France to process the bulk of asylum claims made by those hoping to reach the U.K.

This has significantly reduced the number of refugees arriving in Britain: from 80,000 in 2003 to 30,000 in 2016. In return, Britain has committed massive financial resources — hundreds of millions of pounds — to French border security and increased cooperation on smuggling, security and counterterrorism.

While London benefits disproportionately from the setup, there are advantages for France as well. Fewer migrants pass through its territory to reach British shores, and Paris gains from the political stability that a tightly controlled border affords its neighbor.

The U.K. is lucky that it’s Macron and not Le Pen that will be reexamining Le Touquet. But it can’t afford to blind itself to the possibility of the treaty’s demise.

But Brexit has changed the diplomatic calculus. On the campaign trail, Macron, who incidentally owns a house in the seaside town of Le Touquet, vowed to take another look at the treaty to ensure France will be getting a fair deal after Britain leaves the EU.

For the U.K., the consequences could be far-reaching. If Macron scraps the treaty, the British border will move from Calais back to Dover. Migrants seeking asylum in the U.K. would no longer be stopped by a border official on French shores, and Britain would be obliged under (non-EU) international law to process their case.

This is terrible timing for British Prime Minister Theresa May. The U.K., with its multicultural society, liberal labor market and English language, is an attractive destination for refugees. The key reason Britain has been relatively untouched by the refugee crisis is that the smugglers know the chances of successfully getting there are low — in large part thanks to the defenses provided by Le Touquet.

The death of the treaty would have dire implications for May’s promise to cut net migration to the “tens of thousands” — a major let-down for British voters, for whom migration has emerged as a major issue.

This would be difficult enough if Britain had chosen to remain part of the EU. Brexit makes it even more complicated.

When Britain leaves the bloc it will no longer be part of the EU’s Dublin Regulation, which mandates that asylum seekers must be processed in the country of first arrival. The law also prevents so-called asylum shopping by stipulating that a migrant whose claims are rejected in one country are considered to be rejected across the EU.

If Britain does not remain part of this treaty, or strike a similar deal on migration, any asylum seeker who has been rejected by another EU country could head to the U.K. for a second try, at precisely the moment its border control has been significantly weakened.

May’s assertions that Le Touquet will stand because it is in both countries’ interest is short-sighted. The diplomatic calculus has changed dramatically over the past 12 months. London must take Macron at his word, rather than simply assuming the treaty will remain untouched.

France, along with the rest of the EU, has pledged not to negotiate bilaterally with Britain ahead of its formal exit. And Macron, a staunch pro-European, will abide by this rule. But the French also have strategic objectives regarding Brexit, including a desire to attract London’s financial services to Paris. The prospect of renegotiating the Le Touquet treaty will provide France with considerable leverage over the U.K.

Britain urgently needs to go on a diplomatic charm offensive and address French concerns about the current arrangement. This will mean agreeing to take in vastly more refugees from the Calais border camps where they are currently residing, as well as shouldering a greater share of the asylum burden in whatever deal it strikes with the EU on migration.

Britain also needs to prepare for the (likely) possibility that France will put an end to Le Touquet. That task will fall principally to the government as border control is one of its primary duties. But refugee agencies, aid charities, the port of Dover and the towns of southeast Kent all need to be provided with better planning and resources.

The U.K. is lucky that it’s Macron and not Le Pen that will be reexamining Le Touquet. But it can’t afford to blind itself to the possibility of the treaty’s demise.