It was a complicated week in parliament that saw Boris Johnson lose several key votes as Parliament came back from summer break.
It was a dramatic first week back for the UK parliament as opposition parties and rebel MPs expedited and passed legislation meant to stop a no-deal Brexit.
MPs had an emergency debate on Brexit when parliament came back from summer break on Tuesday and voted 328 to 301 in favour of taking control of the parliamentary agenda on Wednesday to debate the proposed bill.
The cross-party legislation was aimed at forcing UK Prime Minister Boris Johnson to ask the European Union for a Brexit extension if there is no deal agreed by October 19th. The bill was tabled by Labour party MP Hilary Benn.
Losing support from his own party
Twenty-one Conservative MPs voted against the government in support of discussing the legislation on Wednesday.
Those MPs, in turn, had the Conservative whip withdrawn.
The "rebel MPs" included nine former Cabinet members and Winston Churchill's grandson Sir Nicholas Soames. They will now sit as independents in the House of Commons.
The emergency debate came after Johnson moved to suspend Parliament from September 12 to October 14, mere weeks before Britain is set to leave the EU.
Earlier on Tuesday, Johnson lost his majority when Tory MP Dr Phillip Lee defected to the Liberal Democrats as Johnson was speaking on the floor of the Commons.
On Thursday, Johnson's brother Jo Johnson quit as an MP and higher education minister stating he was "torn between family loyalty and the national interest".
How parliament passed the legislation to stop no-deal
After debating the proposed legislation to prevent a no-deal, the bill was passed in the House of Commons, and Johnson called for a general election on Tuesday, October 15th.
But Johnson needed at least a two-thirds majority to support an election, and the opposition Labour party instructed MPs to abstain. The House of Commons voted 298 to 56 in favour of an election, whereas Johnson needed at least 434 votes.
The Benn bill then went to the UK's upper Parliament, the House of Lords, where it was debated late into the night.
The bill had cleared both houses by Friday night.
Parliament is expected to vote again on a general election this Monday, but opposition parties have said that they are in agreement to block the vote.
Other events over the week
Johnson was heavily criticised after giving a speech on Thursday while surrounded by new police recruits during which he spoke about Brexit and stated he would rather be "dead in a ditch" than ask the EU to delay Brexit.
A West Yorkshire police chief said he was "disappointed" that his officers were used as the backdrop to a political speech and that he had no prior knowledge that the speech would include talk of Brexit.
Meanwhile, the government won in court on Friday when the UK's High Court rejected a legal challenge to Johnson's suspension of parliament before Brexit. The case will be appealed to the Supreme Court and is expected to be heard in late September.