Theresa May has been accused of bribing the DUP with a “magic money tree”, in a deal designed to keep the Tories in government.

It follows her ridicule of Labour’s financial plans during the election campaign, saying they were a “fantasy’. The prime minister said: “There isn’t a magic money tree that we can shake that suddenly provides for everything that people want.”

But she seems to have found a spare £1bn to keep the DUP happy.

So has Theresa May found a fantasy magic money tree after all? Or do the sums add up?

How much will it cost?

Lots of media reports have described this as a £1bn deal. But, it’s a bit more complicated than that and could cost considerably more.

In the documents, the government outlines £1bn of additional spending, on things like infrastructure projects, health and education. Some £910m of this is committed over the next two years, with the remaining £90m continuing over the following three years.

Analysis by the Financial Times suggests the first two years amounts to a 1.3 per cent increase in public spending for Northern Ireland. That’s an equivalent cost of £7 each per year for everyone in the UK.

But there are some important extras which do not come with a clear price tag. This includes working towards devolving control of corporation tax to Northern Ireland and striking a set of “city deals”.

The deal does not contain any estimate of the likely cost of these things, but they could potentially have a big impact on the UK exchequer. In particular, allowing Northern Ireland to lower its corporation tax rate – compared to the rest of the UK – could leave the rest of the country out of pocket.

What’s more, the DUP will probably want another deal in the future when most of the spending commitments draw to a close. The former Permanent Secretary to the Treasury, Nick Macpherson described the £1bn deal as “just a downpayment”.

He Tweeted: “DUP will be back for more … again and again. They have previous in such matters.”

So while there is an upfront cost of £1bn, other commitments written within the deal could cost taxpayers substantially more.

Where is the money coming from?

There is no mention of this in the official documents of the deal. Instead, it just says: “The UK Government is prepared to make additional financial support.” But the word “additional” is key, as it implies it will not be taken from other existing budgets.

Shortly after the deal was struck, Labour’s Emily Thornberry asked the First Secretary of State Damian Green: “Where is the extra £1 billion announced today going to come from? During the election he was fond of telling interviewers that there was no magic money tree. So what has happened today?”

But Green dodged the question, saying simply: “We can afford this because we have a strong economy after seven years of Conservative Government.”

The Treasury has also been pretty short on detail. When quizzed by FactCheck, its only formal explanation was to comment on affordability: “These measures are affordable within the government’s fiscal rules, including getting the structural deficit below two per cent in 2020/21.”

But there was no mention of where the money is actually coming from. We will update this blog if the Treasury provide us with any further details or clarification.

However, we understand that the plan is to take this money out of existing contingency reserves. To avoid extra borrowing or cutting into departmental budgets, the Treasury are likely to dip into their emergency savings.

The Treasury will be keen to downplay this as nothing more than minor budgetary adjustments. But, in January, the chancellor Philip Hammond seemed to describe this move as more of a last resort to deal with crises, rather than covering its regular commitments.

Valued at around £27bn, he said the government could use the “fiscal headroom, if needed, to deal with unforeseen, unforecast economic shocks, and scope to invest to raise productivity and so to lift real wages and living standards.”

It appears the government thinks the current situation warrants tapping into this contingency fund.

How about the rest of the UK?

There’s no extra money for Scotland, Wales or England. And critics of the DUP deal have pointed out that Northern Ireland is already the best funded UK region, in terms of spending per person.

In 2015/16, public spending in Northern Ireland was around £10,983 per person (including devolved spending). This compares to £7,977 in the south east of England. This excludes spending deemed to benefit the UK as a whole, like defence costs.

But this need be seen in context.

First, public spending covers different things in different regions. For instance, in Northern Ireland and Scotland the water industry is effectively in public hands. Whereas, in England and Wales, it is privatised.

Second, the figures are partly down to things like a high proportion of public sector employment. It’s not all subsidies and investment.

Third, it’s worth remembering that Northern Ireland has suffered from high levels of poverty and deprivation for years. One in five people live with relative low income, compared to just 12 per cent in the south east of England. And charities say that more than a quarter of all children in Northern Ireland live in poverty.

So, higher spending – especially in areas like benefits, healthcare and housing – is inevitable in the current system. After all, that is what the welfare state is designed for.

It’s true that the DUP deal makes public spending even more disproportionate between regions. But whether that is “unfair” or not is more a matter of opinion. (There is a subtle but important distinction between critics who say public spending should be expanded across the UK, and those who seek to focus on regional differences).

Is this a ‘magic money tree’?

Obviously, this is a pejorative term with no clear definition. If we use the Conservative’s own use of it, then we cannot just be referring to spending commitments that are completely impossible.

For instance, during the election campaign, Theresa May told a nurse that wages for NHS staff could not be increased because “there is no magic money tree”.

Labour had committed £4bn to lifting the wage freeze right across the public sector. To fund it, they said they did not intend to eat into the government’s contingency reserves at all and proposed a new tax plan and other changes instead.

But even if this had not worked, the £4bn that Labour promised could have easily been covered by the reserves May has now tapped into to fund her DUP deal.

Here at FactCheck, we think “magic money tree” is always going to be an unhelpful phrase. We prefer statistics to soundbites. After all, both Labour’s spending plans and the Conservatives DUP deal are both technically possible – it’s just a question of priorities.

But if it was fair for the Conservatives to accuse Labour of relying on a magic money tree, it is certainly fair for the accusation to now be thrown back at them.