Philip Hammond has not ruled out resigning as chancellor over Theresa May’s attempt to spend billions of pounds on her “legacy”, in her last days in No 10.

Friends of the chancellor acknowledged his “frustration” at the prime minister’s attempt to throw huge sums at education and other voter-friendly projects, despite resigning.

However, they played down a claim he is poised to quit, because he now believes he is winning the battle with his next-door neighbour.

One source told The Independent they “don’t think” Mr Hammond will resign, noting that Ms May appeared to have “cooled” on opening the purse strings in the last few days.

“Over the last three years, multiple reports of the chancellor's impending resignation have proved to be premature,” a friend said.

John McDonnell leapt on the row as “another example of how far the Tories are cut off from the real world”.

Who is standing to be the next prime minister? Show all 3 1 /3 Who is standing to be the next prime minister? Who is standing to be the next prime minister? Boris Johnson - 157 votes Foreign Secretary Boris Johnson arriving in Downing Street, London, for a Cabinet meeting where Theresa May will brief on her plans for Brexit before a major speech aimed at helping to break the deadlock in the negotiations with Brussels. PA Who is standing to be the next prime minister? Michael Gove - 61 votes LONDON, ENGLAND - JUNE 07: Britain's Environment Secretary Michael Gove leaves 10 Downing Street on June 7, 2018 in London, England. Prime Minister Theresa May is holding an emergency Brexit cabinet meeting in an attempt to resolve tensions over the UK's Irish border plan. (Photo by Simon Dawson/Getty Images) Getty Who is standing to be the next prime minister? Jeremy Hunt - 59 votes Health and Social Care Secretary Jeremy Hunt leaving Downing Street, London, after attending a Cabinet meeting. PA

“Instead of resigning because of May’s attempt to spend more on education, Hammond should resign because his austerity policies have resulted in the suffering of hungry children in class,” the shadow chancellor tweeted.

No 10 is understood to have urged Mr Hammond to free up money from the £27bn “war chest” he set aside in case of a no-deal Brexit to fund fresh spending.

Ms May has been stung by criticism that education spending has dropped sharply, forcing some schools – including the one she attended – to close early on Fridays and beg for cash.

The chancellor has been arguing she must not bind the hands of her successor, but is now more confident that Downing Street is stepping back from a clash that would force him out.

“I don’t think he will resign,” the source said. “No 10 appears to have cooled on the public spending pressures in the last few days.”

The source stressed that Mr Hammond was not opposed to more spending on education, but added: “He simply thinks it should be a decision for the next prime minister.”

“We don’t know the Brexit policy that will result from this leadership contest – and, after nine years, the next PM will actually have a choice to make.”

Asked about Mr Hammond’s position, the prime minister’s spokesman said: “It has been quite hard keeping up with the anonymous quotes from friends of the chancellor in recent days.”

Ms May, who will leave power on or soon after 22 July, has already sought to define her legacy with pledges to tackle climate change, mental health and modern slavery.

This week, she set out plans for new teachers to receive training on how to spot the signs of mental health problems in youngsters, under a plan to overhaul society's approach to the issue.

However, the Institute for Fiscal Studies (IFS) has highlighted how a £3.8bn cash injection is needed to reverse 8 per cent of cuts in per pupil school spending, in recent years.

After that, a further £1.1bn would be needed each year up until 2023 to maintain spending in real terms, once rising costs were taken into account, it warned.