The EU-UK withdrawal agreement is a home secretary’s Brexit. Controlling immigration is the focus of all its contortions.

When Theresa May became prime minister in 2016, she had been home secretary for six years – a near-record tenure in a department considered a minefield.

Her four predecessors had lasted an average of 18 months each.

Immigration defined May’s time at the Home Office. She talked tough, failed to deliver, yet somehow got away with it.

Her first promise was to cut net immigration in half. Instead it rose to more than triple her target figure.

She pledged to create “a really hostile environment for illegal migrants” and wrongly blamed the Human Rights Act for being unable to go further, earning a rare rebuke from England’s senior judiciary.

She ignored warnings about passport backlogs and chaos at border posts.

In a foreshadowing of the Brexit campaign, she put ads on the side of lorries telling people to “Go home or face arrest” – until the ads were banned for inaccuracy, as the Home Office could barely arrest anyone.

In 2016, as the immigration figures kept rising, prime minister David Cameron was unable to secure concessions on free movement from the EU, despite warning he would have to argue for Remain on this issue. He ended up begging German chancellor Angela Merkel for help days before the referendum, to no avail.

When May succeeded Cameron days later and declared “Brexit means Brexit”, observers already suspected this would mean first and foremost “Regaining control of our borders” – a phrase she has gone on to make her own.

May’s failure

As apparently more urgent Brexit issues have arisen over the customs union, single market and Irish Border, May’s priority can be seen in retrospect as ensuring an end to EU free movement.

Fraser Nelson, editor of the Spectator, describes the resulting withdrawal agreement as “Remain, without freedom of movement”.

This critique applies to the backstop and the political declaration on a future trading arrangement. The awkward point around which both are constructed is staying just far enough outside the single market to avoid its free movement requirements. Every other requirement remains either in force under the backstop or in play for the future arrangement.

The tragedy of immigration as a driving force for Brexit is that there is appreciable scope under EU rules for controlling European immigration, while the UK has always had full control over non-European immigration. The latter was clearly of more concern to the Ukip voters who provoked Cameron into calling the referendum.

Tracking people at the beginning and end of their journeys will always be more emotive than checking goods 'in the market'

But May cannot admit that without conceding her own failure to exercise the controls she is now claiming to “take back”.

So the UK is set to embark on negotiating a future trading arrangement with immigration setting the agenda. That is likely to remain true if May or her withdrawal agreement fall, as the notion has been baked into the process.

This has enormous implications for Ireland, which shares a de-facto immigration system with the UK via the Common Travel Area, facilitated by Ireland’s opt-out from the EU’s Schengen zone.

As the UK aspires to a tougher system, will the Republic want to follow? If the British public begins to see Ireland as an unlocked back door, will they want to preserve the Common Travel Area? And might some Irish people find a tougher immigration regime appealing, creating a divisive internal debate?

Disappearing act

The Common Travel Area has been viewed as a straightforward, ready-made solution to movement of people. It has the backing of the EU under the withdrawal agreement. But a report last month by UK-based legal academics warned it had no statutory basis – the Common Travel Area has the disconcerting property of disappearing when you try to look straight at it.

Presenting their report to a cross-Border human rights committee operating under the Belfast Agreement, the academics advised that a new Anglo-Irish Treaty would be necessary to formalise the Common Travel Area after Brexit.

Rather than tying up a loose end, this could become a pressing concern. It is easy to foresee a dispute emerging over the movement of people that parallels the argument over the movement of goods, with any physical manifestation of a land border judged unacceptable and a sea border entering the frame.

This would in turn be unacceptable to the DUP, which has every chance of holding the balance of power at Westminster until 2022, thanks to the UK’s Fixed-term Parliaments Act.

As with the movement of goods, technology promises long-term solutions. But tracking people at the beginning and end of their journeys will always be more emotive than checking goods “in the market”. Would Irish people be prepared to see their Public Services Cards linked to a new UK identity card, with every British official entitled to check it? Might Schengen membership start to appear preferable?

Those have to be seen as worst-case scenarios, which raises a dispiriting prospect. Not only will a Common Travel Area treaty have to be negotiated – it will need a backstop.