His intervention came as MPs prepare to debate the Internal Market Bill on Monday, with Boris Johnson facing growing criticism that breaching international law would jeopardise the UK’s standing in the world.
Mr Cameron is the fifth former Prime Minister to slam the bill after Theresa May, Sir John Major and Lord Howard also spoke out. Former Labour PM Tony Blair also urged MPs to reject the “shaming” legislation, saying it imperils the Irish peace process, trade negotiations and the UK’s integrity.
The former Conservative leader 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 an absolute final last resort.
“So I do have misgivings about what is being proposed.
“But I would just make this point: so far what has happened is the Government has proposed a law that it might pass or might not pass or might use or might not use depending on whether certain circumstances do or do not appear.
“Of course the bigger picture here is we are in a vital negotiation with the European Union to get a deal and I think we have to keep that context, that prize in mind and that’s why I’ve perhaps held back from saying more up until now.”
Mr Johnson’s former attorney general Geoffrey Cox has led the criticism, saying it would be “unconscionable” to override the Brexit divorce deal.
The Tory MP said there is “no doubt” the “unpalatable” implications of the Withdrawal Agreement were known when the Prime Minister signed it, at a time when Mr Cox was the chief law officer.
The Brexiteer warned he would not back the Internal Market Bill unless ministers dispel the impression they plan to “permanently and unilaterally” rewrite an international agreement.
The QC, who was attorney general during the unlawful suspension of Parliament said tariffs and customs procedures on certain goods entering Northern Ireland from Britain were part of the deal.
“There can be no doubt that these were the known, unpalatable but inescapable, implications of the agreement,” he wrote in The Times.
He said if the powers in the Bill were used to “nullify those perfectly plain and foreseeable consequences” then it would amount to the “unilateral abrogation of the treaty obligations” signed in October.
“It is unconscionable that this country, justly famous for its regard for the rule of law around the world, should act in such a way,” he added.
He later said that he had spoken to Mr Johnson about his objections to the bill, which the Government argues is necessary to guarantee unfettered trade across every part of the UK.
He told Times Radio: “I have spoken to the Prime Minister. We’ve had long discussions and I know the Prime Minister is giving very careful thought to these things.
“And I know the Government feels that it really has no choice, that if the actions of the EU are borne out (…) if the statements they appear to have made are fulfilled. It would place an enormously difficult problem in the way of the United Kingdom and Northern Ireland.
“It would amount to a demonstration of a want of good faith for which the Government should take action,” he added.
“It’s just the action it should take, in my view, shouldn’t be unlawful.”
Meanwhile, Labour leader Sir Keir Starmer said the Government’s position was damaging to the country as he accused the Prime Minister of being “all over the place”.
“He is making a mistake reneging on a treaty, that will have reputational damage for the UK,” Sir Keir told LBC radio on Monday.
“Here we are on the world stage for the first time in many years on our own and what’s the first thing we do? We break a treaty.
“It’s basic stuff – if you say to other nations we agree something and a few months later you say no we don’t, the chances are they aren’t going to trust you going forward.”
Asked what Mr Johnson needed to do to get Labour support for the Bill, Sir Keir said: “I do think we need legislation on an internal market and we would support that if the Government took away these problems, didn’t breach international law and act in this way.
“I would say to the Prime Minister, look go away, go back to the drawing board, drop these problems, don’t act in this reckless and wrong way and we’ll look again at the legislation.”
He added: “My message to Boris Johnson is: get on with it and actually focus on what most people are speaking about this morning which is how on Earth do we defeat and deal with this pandemic?
“That’s what’s on people’s minds – they thought this was over, he’s reopening it, I think the nation would say to Boris Johnson, ‘Get on with it, you’re wrong’.”
Earlier, former Labour leader Ed Miliband said his objections to the Internal Market Bill were not about “remain or leave” but an argument of “right or wrong”.
He told BBC Breakfast: “This is not about reheating the Brexit argument, it is not about remain or leave, we’ve left the European Union, this is really about right or wrong.”
Mr Miliband added: “In politics when you are confronted by something as extreme as this, breaking the law, on a day when we are saying to families around the country ‘it’s really important that you obey the law, because our health and survival depends on it’.
“We cannot have the government coming along and breaking the law. Because it sends all the wrong signals both at home and abroad.”
However, Home Office minister Kit Malthouse said he would vote for the UK Internal Market Bill even if it breaks international law.
Mr Malthouse insisted the bill was necessary to keep food flowing between Britain and Northern Ireland.
Speaking to BBC Radio 4’s Today programme, he said: “We can’t allow a situation where GB cannot supply food into Northern Ireland.”
Asked what he thought Mr Cox’s intervention, Mr Malthouse said: “Well it’s very poetic but it doesn’t, for me personally, solve the problem that we’re faced with, which is we’re in a situation where if this third-country status is withheld from the UK.
“It means that food exports from GB to Northern Ireland could in theory become illegal in the future and in those circumstances I’m not quite sure what a British Prime Minister is supposed to do.”
But Simon Hoare, Tory chairman of the Commons Northern Ireland Affairs Committee, said the former attorney general’s stance could not be ignored.
“Geoffrey is a man for whom respect for the Rule of Law (and it’s defence) is paramount. His intervention cannot be overlooked, ignored or swatted away,” Mr Hoare tweeted.
Highlighting the influential role Mr Cox played among backbench MPs during Theresa May’s Brexit battles, he wrote: “I remember hearing lots of colleagues saying at the time: ‘if Geoffrey says it’s no dice; I’m not playing’.
“As a committed Brexiter he should remain an important lightening (sic) rod.”