Image copyright PA Image caption The prime minister said she wanted a deal and believed one was achievable

The government will spend whatever is necessary to make sure the UK is ready for Brexit, Downing Street has said.

A No 10 spokesman said £250m of new money had been allocated this year to prepare for leaving the EU, "including the possibility of a no-deal scenario".

Speaking at Prime Minister's Questions, Theresa May said "where money needs to be spent it will be spent".

Earlier, Chancellor Philip Hammond said funding for a no-deal plan would not happen "until the very last moment".

He suggested it was not wise to spend money - which could alternatively go to the NHS or schools - at this stage on an outcome which may or may not happen, merely to "send a message" to the EU.

In response, several Tory MPs have criticised the Treasury, one accusing it of "incompetence" and another suggesting the EU would not listen to the UK unless it was sure it was seriously preparing for the possibility of leaving in March 2019 without a negotiated agreement.

The BBC understands a row broke out at Tuesday's Cabinet meeting over the issue of contingency funding in the event of a "no deal" scenario in the Brexit negotiations.

The BBC's political editor Laura Kuenssberg said two different cabinet sources confirmed there was a "robust" exchange. Downing Street denied there was a row but acknowledged there had been a brief discussion.

She added that how much to spend on preparations for leaving the EU without a deal, and when to spend it, had become a new faultline in the Tories' divisions over Brexit.

Mrs May announced the £250m Brexit contingency funding in response to a question from ex-leader Iain Duncan Smith, who sought assurances "all necessary monies" would be spent in case of a no-deal outcome.

"We are preparing for every eventuality," she told MPs. "We are committing money to prepare for Brexit including a 'no deal' scenario.

"The Treasury has committed over £250m of new money to departments like DEFRA, the Home Office, HMRC and DfT in this financial year for Brexit preparations and in some cases, departments will need to spend money before the relevant legislation has gone through the House."

Mrs May said the UK was striving for a good deal with the EU and rejected claims from a Labour MP that she was "running scared" of her backbenchers and "ramping up" talk about the odds of there being no deal.

Media playback is unsupported on your device Media caption Hammond: Not time yet for 'no deal' spending

Two hours earlier, the chancellor - who has been accused of being too pessimistic about Brexit - told the Treasury committee of MPs that he was "committed" to supporting departments prepare for Brexit but said it would be premature to spend money now on the assumption there would be no deal between the UK and EU.

"We are prepared to spend when we need to spend against the contingency of a 'no deal' outcome," he said.

"I am clear we have to be prepared for a 'no deal' scenario unless and until we have clear evidence that this is not where we will end up."

"What I am not prepared to do is allocate funds to departments in advance of the need to spend," he added.

"Every pound we spend on contingency planning on a hard customs border is a pound we can't spend on the NHS, social care or education. I don't believe we should be in the business of making potentially nugatory expenditure until the very last moment when we need to do so."

Media playback is unsupported on your device Media caption Heidi Alexander says the British people "deserve better than a prime minister simply running scared"

Illustrating what he said was one worst case scenario for a "no deal", he said there could be no air travel taking place between the UK and the EU on Brexit day - 29 March 2019 - but added that he did not see that as likely to happen, even if the UK/EU talks failed to reach agreement.

The current state of Brexit negotiations were a "cloud of uncertainty" hanging over the UK economy, he said, which could only removed by progress and the EU agreeing to begin talks on its future relations with the UK.

One ex-minister, David Jones, has said billions should be set aside in November's Budget for a "no deal" scenario, arguing that if this did not happen it would be seen as a "a sign of weakness" by EU leaders.

And Jacob Rees-Mogg said the Treasury's conduct with regard to Brexit had been "incompetent bordering on the dishonest" and planning for all possible outcomes was a necessary "insurance policy".

"If you think the EU is claiming 100bn euros from us, to have credibility for the no deal scenario we have to show that it's real and it can happen," he said.

"And most of the money that would be spent for no deal would be money that's needed for the end result anyway.

"So, changes to the borders, changes to customs and excise, will need to take place regardless of whether there is a deal or not. So it's not wasted money, it will be money that's very well spent."

Get news from the BBC in your inbox, each weekday morning