The British parliament's upper chamber has approved a bill that aims to block a no-deal Brexit at the end of October by forcing Prime Minister Boris Johnson to seek a delay to Brexit.

The legislation, which requires Mr Johnson to ask for a three-month extension to Britain's EU membership if parliament has not approved either a deal or consented to leaving without agreement by 19 October, is expected to be signed into law by Queen Elizabeth on Monday.

The House of Lords approved the bill without a formal vote at its final stage.

Mr Johnson has dubbed it the "surrender bill" and said it has scuppered his Brexit negotiations with the EU by removing the threat of leaving without a deal.

Yesterday, he said he would rather be "dead in a ditch" than delay Britain's EU exit.

He expelled 21 MPs out of his Conservative Party's parliamentary group earlier this week for working with opposition parties in the House of Commons to pass the legislation against the government's wishes.

Mr Johnson says Britain must now hold a general election on 15 October to let voters decide who they want to negotiate Britain's EU exit at a summit in Brussels later that week.

Opposition parties have so far rejected his call for an election, which would require the backing of two-thirds of the lower chamber's 650 MPs, saying they are not willing to let him dictate the timing of such a vote.

Labour had originally said they would support an election once the bill to prevent a no-deal Brexit at the end of October had become law, but now it says it wants to see the delay to Brexit secured before an election is held.

Earlier, Mr Johnson said he did not want "more dither and delay" to Brexit.

Speaking on a visit to Scotland, Mr Johnson said: "The bill that is still before parliament would, in theory, mean that the government of the UK was obliged to write a letter to Brussels asking for a pointless delay to leaving the EU.

"I don't think that's what people want and I think we were very clear about that, and not only would it oblige the government to do that, it would give the EU the power to decide how long the UK had to stay in and I really can't think for the life of me that that is a democratic way forward.

"The big picture is, look, we've spent a long time trying to sort of fudge this thing and I think the British public really want us to get out.

"They don't want more dither and delay."

Asked if he would not seek the extension, even if passed in law, Mr Johnson said: "I don't want a delay."

On whether he would sack his aide Dominic Cummings, he said: "Look, advisers advise and ministers decide."

Read More:

Mr Johnson said "We can get out of the EU on October 31 and that's what we intend to do.

"I must say I'm perplexed by the decision of the leader of the opposition and the SNP to run away from an election.

"I've never known an opposition in the history of democracy that's refused to have an election but that's their choice.

"I think obviously they don't trust the people, they don't think that the people will vote for them, so they're refusing to have an election.

"And so what we will do is we will go to the summit on the 17th (October), we'll get a deal and we'll come out on October 31."

Regarding the split in his party and when asked at what point he might resign, Mr Johnson said: "What I said is that we had to deliver Brexit, unite the country and defeat Jeremy Corbyn, that's what we're going to do.

Asked again at what point he might resign, he said: "Well, I mean, after those three objectives have been accomplished I will ... at some point after those three objectives have been accomplished." 

Labour leader Jeremy Corbyn held "positive" talks with other opposition parties as they seek to prevent the UK leaving the EU without a deal, according to a party spokesperson.

The spokesperson said: "They discussed advancing efforts to prevent a damaging no-deal brexit and hold a general election once that is secured."

Earlier, a Labour Party source said it would not back Mr Johnson's bid on Monday for an election under the Fixed Term Parliaments Act.

Opposition parties are worried an election in mid-October might still allow Mr Johnson to lead the UK out of the EU without a deal.

Separately, the Prime Minister of Finland, which holds the EU's rotating presidency, said it was obvious that Britain was set to leave the EU without a deal.

"The situation in Britain is quite a mess now, we don't know what is happening there. It seems pretty obvious now that we are not getting Brexit with agreement," Prime Minister Antti Rinne told a news conference in Helsinki.