MPs have rejected a Labour-led effort to take control of Parliament's timetable, blocking the latest attempt to stop a no-deal Brexit.
The Commons opposed the move by 309 votes to 298.
If passed, it would have given opponents of a no-deal Brexit the chance to table legislation to thwart the UK leaving without any agreement on the 31 October deadline.
The result of the vote was greeted with cheers from the Tory benches.
But Labour leader Jeremy Corbyn responded by shouting "you won't be cheering in September".
Ten Tory MPs, mostly pro-Europeans, rebelled against the government by backing Labour's motion. Conversely, eight Labour MPs - mostly Eurosceptics or MPs in constituencies which voted Leave at the referendum - defied party instructions and voted against it.
A key factor for the government was the support of Northern Ireland's Democratic Unionists, who have voted against Theresa May during previous Brexit votes.
No deal would mean the UK leaving the EU without any agreement about the "divorce" process.
Overnight, the country would be out of the single market, customs union and institutions such as the European Court of Justice and Europol.
There are fears about widespread disruption in such an event - to trade, travel and the functioning of the Irish border, in particular.
The opposition said the Commons defeat was disappointing, but it still believed there was a majority in the Commons against a no deal and it remained "determined to win this fight".
"There will be other procedural mechanisms we can use," shadow Brexit Secretary Sir Keir Starmer said. "We are already looking at what those other opportunities will be."
No 10 said giving MPs a "blank cheque" to dictate Brexit policy would have set a troubling precedent.
The UK was originally supposed to leave the EU on 29 March.
But the EU decided on a seven-month extension after MPs rejected the terms of withdrawal on three occasions.
Opponents of a no-deal exit are concerned that Theresa May's successor as prime minister could seek to take the UK out of the EU without parliamentary approval for such an outcome.
Tory leadership frontrunner Boris Johnson and several of his rivals have said the UK must leave the EU by the revised date, whether a deal is passed or not.
Wednesday's motion - supported by the Lib Dems, the SNP and Plaid Cymru, as well as some Conservatives, would not, by itself, have ruled out a no deal.
However, its supporters hoped to start a process on 25 June which could culminate with Parliament blocking the UK leaving without an agreement - in effect, tying the next prime minister's hands.
Backing the motion, Conservative ex-minister Sir Oliver Letwin said the case for ensuring Parliament had a "decisive vote" on the next PM's Brexit plan ahead of the 31 October deadline transcended party politics.
Given that leaving without a deal remains the default legal position, he said it was "perfectly possible" for the next PM to usher in a no-deal exit by "simply doing nothing" at all.
Tory Remain supporter and former Attorney General Dominic Grieve said the motion was the "last sensible opportunity" to stop no deal.
He added that in the future, if necessary, he would support efforts to bring down a Conservative government in a vote of no confidence if it was the only way to block such an outcome.
But veteran Eurosceptic Conservative Sir Bill Cash said it was a "phantom motion" which paved the way for "government by Parliament".
"It just simply opens the door for any bill of any kind to take precedence over government business," he told by MPs. "It is inconceivable as a matter of constitutional convention."
After the defeat, the deputy leader of the Liberal Democrats, Jo Swinson, accused the Conservatives of "putting party loyalty ahead of national interest".
This is not the first time that MPs have attempted to seize control of the Commons order paper in order to shift government policy on Brexit.
MPs voted in March to oblige Mrs May to seek a Brexit delay from the EU.
But efforts by Sir Oliver and others to come up with an alternative Brexit plan failed in April after MPs rejected all the options in a series of indicative votes.