Legal advice on the Brexit deal, published reluctantly after MPs found the government in contempt of parliament, warns the terms of the Irish backstop could trap the UK in “protracted and repeated rounds of negotiations” in the years ahead.

The legal status of the arrangements for preventing a hard border between Northern Ireland and Ireland – and in particular, the UK’s ability to extricate itself – are at the heart of the political row about whether MPs should accept the prime minister’s deal.

In a six-page document finally released on Wednesday, the attorney general, Geoffrey Cox, concedes, as he did in parliament on Monday, that the UK could be trapped indefinitely in the backstop.

He stresses that the protocol setting out the backstop would “endure” even if negotiations between the two sides broke down. “In international law, the protocol would endure indefinitely until a superseding arrangement took its place,” the document says.

Without a legal exit route, unless both sides agree to a satisfactory arrangement that makes the backstop unnecessary, he says the UK would have to rely on the arrangement being politically uncomfortable for the EU because it gives the UK market access without accepting single market rules in full.

However, he warns that disputes about whether the UK should be able to exit could become intractable.

“In the absence of a right of termination, there is a legal risk that the United Kingdom might become subject to protracted and repeating rounds of negotiations,” it concludes.

“This risk must be weighed against the political and economic imperative on both sides to reach an agreement that constitutes a politically stable and permanent basis for their future relationship. This is a political decision for the government.”

The shadow Brexit secretary, Keir Starmer, said: “Having reviewed the attorney general’s legal advice, it’s obvious why this needed to be placed in the public domain.

“All week we have heard from government ministers that releasing this information could harm the national interest. Nothing of the sort. All this advice reveals is the central weaknesses in the government’s deal.

“It is unthinkable that the government tried to keep this information from parliament – and indeed the public – before next week’s vote.”

Leave supporters in the cabinet, including Michael Gove and the then Brexit secretary, Dominic Raab, had insisted on receiving legal advice before they would sign up to the backstop.

Raab subsequently resigned, warning that “the regulatory regime proposed for Northern Ireland presents a very real threat to the integrity of the United Kingdom”.

The details of the advice are likely to inflame the concerns of pro-Brexit MPs who fear the temporary arrangements in the backstop could become permanent.

Cox finds that the “review mechanism”, painted by Downing Street as a negotiating victory, “adds little, other than procedurally, to the international law position to which the protocol is already subject”.

The former chief whip Mark Harper on Tuesday became the latest senior Tory to say his party should reject the deal, and in particular, should repudiate the backstop.

The government was forced to publish the legal advice after being found in contempt of parliament in a pair of historic votes on Tuesday.

Starmer had used an arcane parliamentary procedure called a humble address to demand that Cox’s full legal advice be made available to MPs.

The government failed to contest the humble address, but then insisted it would only publish a summary document, which Cox presented in a statement to the House of Commons on Monday.

Starmer continued to demand the full advice and, after the government lost two votes, the leader of the Commons, Andrea Leadsom, announced that it would be published.