Theresa May, Secretary of State James Brokenshire, and Arlene Foster at the Balmoral Show last month

On Saturday, the government’s chief whip, Gavin Williamson, flew to Belfast for talks with senior DUP figures about the details of the deal which will allow Theresa May to continue as prime minister.

At 7.30pm on Saturday, Downing Street issued a statement which said “we can confirm that the DUP have agreed to the principles of an outline agreement to support the Conservative government on a confidence and supply basis when Parliament returns next week”.

Sign up to our daily newsletter The i newsletter cut through the noise Sign up Thanks for signing up! Sorry, there seem to be some issues. Please try again later. Submitting...

Four and a half hours later, the DUP issued a statement which made clear that the deal had not been finalised, although “the talks so far have been positive”, and it then emerged that Downing Street had apparently released the first statement prematurely by mistake.

Yesterday afternoon, Downing Street provided further detail on what is being discussed, with a Number 10 spokeswoman saying that in a phone call with the taoiseach yesterday “the prime minister explained that she is working towards a confidence and supply deal with the DUP”.

That proposal is entirely in keeping with DUP thought over recent years as it considered what it would do if ever in this position.

Such a deal – which is almost certain to be agreed, given the DUP’s desire to keep Jeremy Corbyn out of Downing Street – would involve the DUP joining with the Tories to vote down no confidence votes and agreeing to pass its budget (the supply side of the equation).

However, unlike a formal coalition agreement which would involve DUP MPs taking the government whip, the DUP will not be bound to vote with the government on any other issue.

Every such occasion where the government requires DUP support will involve a separate negotiation with Arlene Foster’s party.

Details of what the DUP are likely to ask for were set out in 2015 and are largely financial, but the shopping list includes everything from the flying of the Union Flag to parading legislation.

Already some in the Orange Order are pressing the DUP to put parading high up its priorities.

Three years ago, as the DUP looked ahead to what it hoped would be a key role after the 2015 general election, the then DUP leader Peter Robinson gave considerable insight into the party’s thinking.

Addressing the DUP conference, he prepared the party membership for what might be to come and essentially set out the basics of what would have been a confidence and supply deal with either Labour or the Tories.

He said: “Unlike the UUP four years’ ago, it is not places in the Cabinet that we would seek – we ask for nothing for ourselves.

“We want outcomes that would benefit all of our people. We are not seeking to be part of any government coalition, but, with an open mind, we are willing to sustain, in office, a government that offers policies and programmes that are in the best interests of Northern Ireland in particular, and the United Kingdom as a whole. We will be responsible in our approach, and we will use our influence wisely.”

Mrs Foster will tomorrow fly to London with her team of 10 MPs and will later hold talks with the prime minister in Downing Street

Mrs Foster told Sky News yesterday: “We had very good discussions yesterday with the Conservative Party in relation to how we could support them in forming a national government – one that would bring stability to the nation. Those discussions continue.”

The strength of any deal looks set to be tested when the Commons meets, with Jeremy Corbyn vowing to try to bring down the government by defeating Mrs May in Parliament and insisting: “I can still be prime minister.”

In another sign of the dangers facing Mrs May, Sunday papers reported that Boris Johnson was either being encouraged to make a leadership bid in an effort to oust her, or actually preparing one – a claim dismissed as “tripe” by the foreign secretary. However, yesterday ITV obtained messages from a Whatsapp group for Tory MPs in which Mr Johnson was arguing for them to unite behind Mrs May.

Downing Street said that a confidence and supply arrangement with the DUP would “provide the stability and certainty the whole country requires as we embark on Brexit and beyond”.

Mrs May needs support in Parliament because the Queen’s Speech setting out the government’s programme is due on June 19, with a crucial vote on it expected after a few days’ debate.

Last night the DUP’s hardline critic, the TUV leader Jim Allister, said that “anyone with the interests of Northern Ireland at heart, irrespective of party affiliation, will hope that the DUP uses its new position of influence wisely and to good effect”.