Boris Johnson has said the UK must reserve the right to override the Brexit deal to protect the country’s “economic and political integrity”.
The PM said legislation was needed to resolve “tensions” in the EU-UK deal.
He said it would ensure the UK could not be “broken up” by a foreign power and the EU was acting in an “extreme way”, by threatening food exports.
Labour said the PM had caused the “mess” by reneging on a deal he had previously called a “triumph”.
The Internal Markets Bill is expected to pass its first parliamentary test later, when MPs vote on it at 22.00 BST, despite the reservations of many MPs that it gives the UK the power to break international law.
A number of Conservative MPs have said they will not support the bill as it stands and some could register their concerns by abstaining.
The UK left the EU on 31 January, having negotiated and signed the withdrawal agreement with the bloc.
A key part of the agreement – which is now an international treaty – was the Northern Ireland Protocol, designed to prevent a hard border returning to the island of Ireland.
The Internal Market Bill proposed by the government would override that part of that agreement when it came to goods and would allow the UK to modify or re-interpret “state aid” rules on subsidies for firms in Northern Ireland, in the event of the two sides not agreeing a future trade deal.
Speaking at the start of the five-hour debate, the PM said the bill should be “welcomed by everyone” who cares about the “sovereignty and integrity of the UK”.
He said the UK had signed up to the withdrawal agreement, including the Northern Ireland Protocol, in “good faith” in the belief that it would result in “light touch” regulations on trade within the UK.
He said the “protective powers” in the bill were necessary to guard against the EU’s “proven willingness” to interpret aspects of the withdrawal agreement in “absurd” ways that were never intended.
“What we cannot tolerate now is a situation where our EU counterparts seriously believe they have the power to break up our country,” he told MPs.
“We cannot have a situation where the very boundaries of our country can be dictated to by a foreign power or international organisation.”
He also suggested the EU was threatening not to allow Britain to export products of animal origin to either the continent or Northern Ireland and “had not taken that revolver off the table”.
He sought to reassure MPs that the UK would continue to work with the EU to resolve their differences with “common sense and goodwill” and MPs would be given a vote before the reserve powers were ever invoked.
“I have absolutely no desire to use these measures. They are an insurance policy.”
But former Labour leader Ed Miliband, standing in for Sir Keir Starmer after the Labour leader was forced to self-isolate at home, said the “very act of passing the law” would constitute a breach of international law.
He told MPs the PM “could not blame anyone else” having drawn up and signed the Brexit deal himself.
“It is his deal, it is his mess, it is his failure,” he said. “For the first time in his life, it is time to take responsibility and to fess up,” he said. “Either he was not straight with the country in the first place or he did not understand it.”
He added: “This is not just legislative hooliganism on any issue, it is on the most sensitive issue of all.”
Conservative MP Sir Bob Neill said the government must “exhaust” all avenues available through the existing agreement to resolve its differences before taking such as a profound step.
The government’s actions, he said, were “needlessly provocative” to the ongoing trade negotiations and “needlessly undermine our reputation for sticking to the rule of law”.
And Former Chancellor Sajid Javid has joined the ranks of potential rebels, saying he could not see why it was necessary to “pre-emptively renege” on the withdrawal agreement signed with the EU.
“Breaking international law is never a step that should be taken lightly,” he tweeted.
A senior government source told the BBC “all options are on the table” in terms of possible action against Tory MPs who do not support the bill.
The legislation, which sets out how trade between different nations of the UK will operate after the UK leaves the single market on 1 January, is likely to face more difficulties in its later stages, especially in the House of Lords.
The SNP’s Ian Blackford said the bill was the “greatest threat” to devolved government in Scotland since the establishment of the Scottish Parliament 20 years ago.
“We are discussing the details of a bill which this government casually and brazenly admits breaks international and domestic law, a bill that cynically uses the precious peace at the heart of the Good Friday Agreement as nothing more than a Brexit bargaining chip,” he said.
Five former prime ministers have raised concerns about the bill, including Boris Johnson’s predecessor Theresa May – who is absent from Monday’s debate as she is on a visit to South Korea.
Speaking earlier on Monday, David Cameron said “passing an act of Parliament and then going on to break an international treaty obligation…should be the absolute final resort”.