A controversial government Brexit bill that breaches international law has safely passed its final House of Commons hurdle, despite continued serious doubts among a number of Conservative MPs about the plan. The internal market bill, which primarily sets out technical post-Brexit details involving the devolved nations, also gives ministers the power to unilaterally rewrite elements of the withdrawal agreement with the EU. It passed its third reading on Tuesday night by 340 votes to 256 and will now go to the House of Lords. The provisions in the bill have prompted significant disquiet, particularly after the Northern Ireland secretary, Brandon Lewis, told the Commons earlier this month that they did break international law “in a very specific and limited way”. The subsequent furore saw two Tory MPs vote against the bill at its initial Commons vote earlier this month, with 30 more abstaining, although some of these did not vote because they were absent. No Conservative MPs voted against the bill on Tuesday night, though more than 20 did not vote, with the majority assumed to be abstentions, Theresa May among them. The former prime minister was in Westminster on Tuesday, and as a vocal opponent of the bill seemed likely to be a deliberate abstention. Other Tory MPs who did not vote include the former attorneys general Geoffrey Cox and Jeremy Wright. Boris Johnson argued the law-breaking measures were needed to counteract the possibility of the EU responding to a lack of a permanent trade deal in December by effectively blocking goods from entering Northern Ireland from the rest of the UK, an idea critics have said is highly unlikely. The rebellion coalesced around an amendment led by the Conservative backbencher Bob Neill, which decreed that the government could only use the powers to change the Brexit departure deal with prior approval of MPs. Amid continued Tory unrest that saw the resignation of Lord Keen, the UK government’s law officer for Scotland, the government agreed an amendment broadly similar to Neill’s plan. This did not satisfy every malcontent, with May using a Commons speech last week to condemn the idea of ditching elements of the withdrawal agreement, which has the status of a treaty and is thus protected under international law, as “reckless” and “irresponsible”. Speaking for Labour on Tuesday, the shadow business minister Lucy Powell said the government was being reckless and “using Northern Ireland as a pawn in a wider negotiating strategy”. She added: “The government are playing a dangerous game, and it’s the people and businesses of Northern Ireland who risk paying the price.” Speaking before the vote, Tobias Ellwood, the former defence minister who abstained in the last vote, said he and some colleagues would support the bill out of necessity. “Many people will be far from content, but they recognise the politics of where we sit,” he said. “We’re just running out of time. If a number of planets were to align, we would find ourselves in a worse place where the absence of this legislation could cause more problems on top of no deal. “No deal would be damaging on so many fronts, but for us not to have the basis for an internal market in place, which 80% or 90% of this bill focuses on – you’ve got to have it in place by 1 January.” The bill will now move to the Lords, where Johnson faces potentially stiffer opposition, not least from Michael Howard, the former Tory leader who has also condemned the law-breaking plan. However, the timetable for the Lords has yet to be set out, prompting more speculation that the contentious elements might be aimed more as a negotiating stick for the EU rather than an urgent legal necessity. Lord Neuberger, former president of the supreme court, has condemned the bill as a “flagrant breach” of the UK’s international law obligations that would “muzzle” British courts. Speaking at an online seminar organised by the International Bar Association on Tuesday evening, Neuberger said there would be moral and practical ramifications. He asked how the government, which is passing some “pretty draconian” laws through Covid-19 health regulations, could expect people to obey them if it is “seen to be breaking its obligations on the international law stage”. At the same meeting, Prof Philippe Sands QC warned that the government’s threat to break international law would “undermine the UK’s negotiating position” in any future treaties with other countries and destroy our reputation for being trustworthy. Former MP Dominic Grieve QC, previously a Conservative attorney general, said the bill was unprecedented, drives a “coach and horses” through the UK’s international obligations and would do us “massive reputational damage”.