David Davis stepped back and forth from the brink and back again before many people in Westminster had even digested their breakfast on Thursday, in a tense showdown over the terms of the Brexit backstop to avoid a hard border in Northern Ireland.

May’s premiership has seen the resignations of four cabinet ministers, but to lose her Brexit secretary might have been the fatal blow. Yet Davis was mollified in the end with a concession to insert an end date in the final text of the proposal, one that may ultimately carry little weight.

The row could hardly have been said to have come out of nowhere. The spectre of the Irish backstop agreement had been hovering for six months, a blueprint Britain signed up to in the deal reached with the 27 EU members states in December.

Both sides claim victory as No 10 makes backstop 'concession' Read more

The backstop – which was crucial to the deal to allow Brexit negotiations to move on in December – would keep the whole of the UK inside key aspects of the customs union until a permanent arrangement can be put in place to avoid border checks between Northern Ireland and the Republic.

No 10 has said consistently it is a fall-back option, and a temporary one, and it hopes to agree a different customs solution with Brussels. Attempts to reach that solution has exacerbated the tensions between remain and leave cabinet ministers; the two sides seemingly irreconcilably opposed.

When the Department for Exiting the EU first saw May’s detailed plan for the backstop, set to be presented to negotiators in Brussels, it contained no legally enforceable end date. Sources close to Davis said that was something the Brexit secretary could never accept.

The Guardian view on the Brexit backstop row: much ado about nothing | Editorial Read more

Rumours had swirled that Davis was poised to quit for almost 12 hours by the time the Brexit secretary met the prime minister on Thursday morning for a tense hour-long meeting in her House of Commons office behind the Speaker’s chair. Afterwards, his aides looked stony-faced as they passed waiting journalists and escorted their boss back to 9 Downing Street.

Government sources briefed journalists that the meeting had been “conclusive” but within minutes it became clear that it had not. No deal had been reached and Davis’s future was still in doubt.

Though the customs backstop was the touchpaper, many other frustrations were kindling. Davis is frustrated with the slow pace of Brexit, the delay of his white paper on the government’s detailed plans until after the crucial Brussels summit later this month, and the government’s failure to agree a customs arrangement.

In their meeting, where the pair were the only two in the room, Davis voiced his frustrations more widely than the backstop, insisting there should be a commitment to speed up the publication of the white paper.

Less than an hour after the pair had met in Parliament, Davis was back in Number 10 for a second meeting with the prime minister. It was there, sources said, that the deal to insert the date was finally struck.

Brexit: what is the UK's backstop proposal? Read more

Allies played down the idea he had ever been prepared to walk out. “He has said he was going to meet [chief EU negotiator] Michel Barnier next week, does that sound like a man about to resign?” one source said. Another said that threats were “not in his nature”.

But after a chaotic 24 hours, the fact remains that there is still no legally enforceable end date in the text. May has kept her Brexit secretary in the fold and conceded almost nothing, although Davis’s allies will say the inclusion of the date now makes it politically impossible for the backstop to become the status quo.

Crucial to the new text is the word “expects” – “The UK expects the future arrangement to be in place by the end of December 2021 at the latest.” That phrase is no firm commitment. Downing Street has always argued it needs to be able to credibly sell the proposal to Brussels – and an insurance option against a cliff edge, which in itself has a cliff-edge, would not fly.

Senior civil servants have already told ministers that the highly complex new customs systems are unlikely to be ready for another five years. If and when the row comes in 2021, a year when an election will be looming, neither May nor Davis may be around to deal with the consequences.

What may be more damaging in the short-term is yet another public split ahead of a crucial June summit in Brussels. “The prime minister clearly has no authority and this entire affair just smacks of incompetence,” fumed one Tory source. “We can’t even agree our own position in dignity and private.”