David Cameron has become the fifth former prime minister to criticise a new bill attempting to override the Brexit withdrawal agreement.
The Internal Market Bill will come before MPs later, with the government calling it an “insurance policy”.
Mr Cameron said he had “misgivings” over it and breaking an international treaty should be the “final resort”.
Former Tory PMs Theresa May and Sir John Major, and Labour’s Tony Blair and Gordon Brown have condemned the plan.
Earlier, Policing Minister Kit Malthouse called it a “practical” step.
He echoed comments made by Justice Secretary Robert Buckland on Sunday, who said the bill was there just in case the UK and EU do not agree a post-Brexit trade deal.
The government is expected to win tonight’s vote in the Commons on the latest stage of the bill – which is expected around 22:00 BST (21:00 GMT) – but it is expected to face more difficulties in later stages, especially when the legislation heads for debate in the Lords.
But former Attorney General Geoffrey Cox has said he will vote against it, accusing the current Prime Minister Boris Johnson of doing “unconscionable” damage to Britain’s international reputation.
Labour’s shadow business secretary, Ed Miliband, also called the proposed law “legislative hooliganism”.
The UK left the EU on 31 January, having negotiated and signed the withdrawal agreement with the bloc.
The two sides are now in the closing weeks of negotiations for a post-Brexit trade deal before the transition period ends on 31 December.
A key part of the withdrawal 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.
Last week, Northern Ireland Secretary Brandon Lewis said the bill would “break international law” in a “specific and limited way”, leading to swathes of criticism from all sides of the political spectrum.
Mr Cameron – who called the EU referendum when he was PM – said he had “misgivings about what is being proposed”.
Speaking to reporters, he said: “Passing an act of Parliament and then going on to break an international treaty obligation is the very, very last thing you should contemplate. It should be the absolute final resort.”
Mr Cameron said the “bigger picture” was about trying to get a trade deal with the EU, urging the government to “keep that context [and] that big prize in mind.”
The comments follow stronger criticism by the four other surviving former prime ministers of the UK.
Mrs May, who still sits as an MP in the Commons, said breaking international law would damage “trust” in the UK, while Mr Brown said it would be akin to “self-harm” for the country.
Sir John and Mr Blair – who were both in office during key periods of the Northern Ireland peace process – wrote a joint article in the Sunday Times accusing Mr Johnson of “embarrassing” the UK and urging MPs to reject the “shameful” attempt to override parts of the withdrawal agreement.
Mr Malthouse defended the bill, saying it “solves the problem that we’re faced with” over the future of trade with the EU.
He told BBC Breakfast: “What we’ve done is to say transparently that this is a situation which we think may occur – certainly that’s what’s being intimated from the EU. It’s a problem we have to solve so here’s a bill that solves it.
“In the end those people that oppose this bill have to tell us what the resolution is.”
On Sunday, Justice Secretary Mr Buckland told the BBC he hoped powers being sought by ministers would never be needed, and that he would resign if the UK ended up breaking international law “in a way I find unacceptable”.
The bill has split opinion on the Tory backbenches.
MP Sir Desmond Swayne said he would be supporting the bill, praising the government for preparing in case no trade deal is agreed by the end of the year.
He told BBC News: “If the government didn’t take precautions against that possibility, it would be utterly negligent. It is right it arm itself with the powers just in case.”
But his colleague, and chair of the Justice Select Committee, Sir Bob Neill, said the government and its supporters needed to “calm the language”.
He said there was already a mechanism for addressing the government’s concerns, but he was willing to “meet them half-way” with an amendment to the bill – only allowing the elements that would break international law to be used if Parliament signs it off.