Prime Minister Boris Johnson insisted Monday that a new Brexit deal can be reached to ensure Britain leaves the European Union by the Oct. 31 deadline, as he prepared to suspend Parliament and send rebellious lawmakers home until two weeks before the country is supposed to leave the bloc.

Lawmakers used the hours before the suspension to deliver new blows to Johnson's teetering authority. An opposition-backed measure designed to stop Britain from crashing out of the EU on Oct. 31 without a divorce deal became law after receiving the formal assent of Queen Elizabeth II. That came hours before legislators were set to reject Johnson's demand for a snap election to break the political deadlock engulfing the government.

Meanwhile, Speaker John Bercow, whose control of business in the House of Commons has made him a central player in the Brexit drama, announced he would step down after a decade in the job.

Johnson insists Britain must leave the 28-nation EU in just over 50 days, come what may, but acknowledged that leaving without an agreement on divorce terms "would be a failure of statecraft" for which he'd be partially to blame.

On a visit to Dublin, Johnson said he would "overwhelmingly prefer to find an agreement" and believed a deal could be struck by Oct. 18, when EU leaders hold a summit in Brussels.

The comments marked a change of tone, if not substance, from Johnson, who is accused by opponents of driving Britain at full-tilt toward a cliff-edge Brexit. Cabinet Minister Amber Rudd resigned over the weekend, saying she didn't believe Johnson was sincere about seeking a deal.

Irish Prime Minister Leo Varadkar warned Johnson that "there's no such thing as a clean break," and if Britain crashed out, it would "cause severe disruption for British and Irish people alike."

After their first meeting since Johnson became prime minister in July, the U.K. and Irish leaders said they'd had "a positive and constructive meeting," but there was no breakthrough on the issue of the Irish border, the main stumbling block to a Brexit deal.

The EU says Britain has not produced any concrete proposals for replacing the contentious "backstop," a provision in the withdrawal agreement reached by Johnson's predecessor Theresa May that is designed to ensure an open border between EU member Ireland and the U.K.'s Northern Ireland.

An open border is crucial to the regional economy and underpins the peace process that ended decades of sectarian violence in Northern Ireland.

Opposition to the backstop was a key reason Britain's Parliament rejected May's Brexit deal with the EU three times earlier this year. British Brexit-backers oppose the backstop because it locks Britain into EU trade rules to avoid customs checks, something they say will stop the U.K. from striking new trade deals with countries such as the United States.

Varadkar said he was open to any alternatives that were "legally workable," but none has been received so far.

"In the absence of agreed alternative arrangements, no backstop is no deal for us," he said. "As for an extension, we'd like to see this dealt with but if there is a good reason to have an extension, we would consider it."

Johnson is adamant he won't ask for an extension to the deadline, saying he'd "rather be dead in a ditch" than delay Brexit.

But an opposition-backed law compelling the government to seek a three-month delay from the EU if no deal has been agreed by Oct 19 became law Monday after receiving royal assent.

Johnson has few easy ways out of it. His options — all of them extreme — include disobeying the law, which could land him in court or even prison, and resigning so that someone else would have to ask for a delay.

He has had a turbulent week since Parliament returned from its summer break on Sept. 3. He kicked 21 lawmakers out of the Conservative group in Parliament after they sided with the opposition, and saw two ministers quit his government — one of them his own brother.

Later Monday, Johnson plans to ask lawmakers to back an early election, which he sees as the only way to break the deadlock. His hope is to win a majority that would support his Brexit strategy.

"There is a simple way for MPs to resolve this," said Johnson's spokesman, James Slack. "All they have to do is vote for an election today so the British public can decide whether they want to get Brexit done on the 31st of October."

But opposition parties say they will vote the measure down, because they want to make sure a no-deal departure is blocked before agreeing to an election.

Immediately after the vote, Parliament will be prorogued, or suspended, a highly unusual move by the government that limits Parliament's ability to block Johnson's plans for Brexit. It is being challenged in court by opponents who say the suspension is anti-democratic and illegal.

Amid the division, lawmakers were united in paying tribute to Bercow after he announced he will step down as speaker and member of Parliament on Oct. 31.

The colorful speaker, famous for his loud ties and even louder cries of "Order!" during raucous debates, told lawmakers he will quit the same day Britain is due to leave the EU, unless an election is called before then. In that case, he will step down ahead of the campaign.

Throughout the three years since Britain voted to leave the EU, Bercow has angered the Conservative government by repeatedly allowing lawmakers to seize control of Parliament's agenda to steer the course of Brexit.

He said he was simply fulfilling his role of being the "backbenchers' backstop" and letting Parliament have its say.

"Throughout my time as speaker, I have sought to increase the relative authority of this legislature, for which I will make absolutely no apology," he said.