The UK must be prepared to leave the EU without a deal at the end of October, the Welsh secretary has said.
Alun Cairns said ministers must "act on the instructions of the referendum", even if it means a no-deal Brexit.
But he said he wants a deal and believes "genuinely" the UK will get one if Boris Johnson is prime minister.
A spokeswoman for Wales' First Minister Mark Drakeford said Mr Cairns's comments "seem to be more about protecting his own job".
Mr Cairns has endorsed frontrunner Mr Johnson in the Conservative leadership race, claiming he could "unite" the country.
European Union leaders granted the UK a six-month extension to Brexit in April. The new deadline is the 31 October.
The Welsh secretary said that preparing for a no deal is the "best way" to deliver a deal.
He was told the government could prepare for that scenario, but was asked whether he was prepared to leave without a deal.
Mr Cairns said: "If we need to because we have to act on the instructions of the referendum, but I don't think we'll be in that position because I genuinely believe we'll get a deal."
Mr Drakeford's spokeswoman said: "The secretary of state's comments seem to be more about protecting his own job in the event of a new prime minister rather than standing up for the thousands of Welsh workers losing theirs as a result of Brexit.
"A no-deal Brexit would hit Wales hard.
"New barriers for our exporters, a loss of free access to Wales' biggest market and the threats to jobs and livelihoods as a result cannot be dismissed with a vague promise that everything will be all right eventually."
Plaid Cymru leader Adam Price called the Welsh secretary's words "worrying at best, and deeply reckless at worst", accusing Mr Cairns of being motivated by "protecting his own interests and keeping his job under the next prime minister".
"He knows that a no-deal Brexit would be a disaster for Wales - for our farmers, our NHS, our manufacturing industry - and could lead to thousands of job losses.
"The European election result showed that Brexit cannot be considered the settled will of the people of Wales, and certainly not a no-deal Brexit."
Both Welsh Labour leader Mr Drakeford and Mr Price want another referendum on EU membership, with Remain on the ballot paper.