David Cameron has agreed to disclose the legal advice to sharply increase the pressure on Alex Salmond, Scotland's first minister. Photograph: Andrew Milligan/PA

Two leading lawyers have told the UK government that an independent Scotland would be forced to renegotiate its EU and UN membership from scratch, in a process that would take years to complete.

In a confidential legal opinion, being published in full by UK ministers, the two experts state that an independent Scotland would have to reapply to join scores of international bodies, including the IMF and World Trade Organisation, causing turmoil for the new government.

It would face having to join the euro, losing the UK's EU rebate, renegotiating farm subsidies and losing its opt-out on the Schengen open borders treaty. The UK was a signatory to 14,000 international treaties, thousands of which would need to be re-examined by the Scottish government's lawyers.

In a highly unusual move, marking a new phase in the dispute over independence, David Cameron has agreed to disclose the advice to sharply increase the pressure on Alex Salmond, Scotland's pro-independence first minister, as polls show declining support for leaving the UK.

Michael Moore, the Scottish secretary, said the findings were a "serious reality check" to Salmond's repeated claims that independence would be a smooth process, where Scotland could negotiate EU membership quickly and in parallel with its independence talks with the UK government.

UK ministers hope its publication will deepen disquiet over Salmond's long delay in commissioning his own legal advice on Scotland's EU membership.

Governments traditionally refuse to publish their legal advice, claiming it would damage their ability to freely discuss and prepare policy, and would breach client-lawyer confidentiality.

In an effort to pre-empt Cameron's move, the Scottish government has has brought forward publication of its own expert report on the economic and fiscal benefits of independence, and will be releasing it an hour before the UK's legal advice is published.

Partly written by the US economist and Nobel prize winner Joseph Stiglitz, the Scottish fiscal commission paper supports Salmond's case that it would be in the UK's interests to agree a formal currency union to allow Scotland to use sterling and retain the Bank of England as its central bank.

The UK government's 57-page legal opinion on the constitutional impact of independence, written by Professor James Crawford of Cambridge University and Professor Alan Boyle of Edinburgh University, is the first of a series of UK government papers that ministers said would prove that Scotland was "stronger and more secure" within the UK.

Moore said it underlined recent statements by José Manuel Barroso, the European Commission president, that an independent Scotland would be regarded as a new member state and not automatically inherit the UK's treaty deals.

"I think it's very, very strong material and will reinforce our central message: Scotland gets a great deal by being part of the UK, and the UK gets a great deal by being part of the EU," he said, on BBC1's Sunday Politics.

One well-placed legal source has told the Guardian, however, that UK ministers are privately worried that Crawford's analysis is not conclusive. He said they admit privately that David Edward, formerly a judge on the European court of justice who disputes Crawford's views, could be right to argue that the EU would not force Scotland to apply afresh but instead allow it to negotiate from within.

The Scottish government's case was underlined last week in a new position paper that claimed Scotland could negotiate its divorce from the UK within 15 months of a yes in the autumn 2014 referendum, allowing it to declare "independence day" in March 2016.

It claimed that was the average time for all 30 other independence treaties since the second world war: the vast majority of those treaties involved small, colonial states such as Chad, Senegal, Togo and Algeria. Only two were EU members: Slovenia and Estonia.

The UK government's legal advice rejects that out of hand. It dismisses Salmond's claims that the current UK would be dissolved after a yes vote, leaving both the rest of the UK and Scotland as equal successor states, and that Scotland would hold talks on EU membership while it was still part of the UK, allowing it to inherit all the UK's opt outs and its rejection of the euro.

Crawford and Boyle, whose analysis was commissioned jointly by the Foreign Office, Cabinet Office and the Advocate General, the UK government's Scottish law officer, said there were four central reasons why Scotland would a new state, starting afresh.

The large majority of recent independence cases showed the rest of the UK would remain the "continuing" state, while Scotland would be treated as a wholly new state, including Russia after the USSR was dissolved, Ireland's independence in 1922 and Sudan and South Sudan in 2011.

The rest of the UK had 90% of the population and 68% of the landmass, while dissolving the UK would cause "huge disruption to the international order", including the UN Security Council, the EU and to Nato. Finally, the UK government had refused to voluntarily dissolve the UK.

The UK government said: "This means that if Scotland became independent, only the 'remainder of the UK' would automatically continue to exercise the same rights, obligations and powers under international law as the UK currently does, and would not have to re-negotiate existing treaties or re-apply for membership of international organisations."

Nicola Sturgeon, Scotland's deputy first minister, said: "I had to laugh listening to Michael Moore because the real uncertainty around Scotland's membership of the EU comes from David Cameron's decision to have an 'in out' referendum [on EU membership].

"We've been very clear that if Scotland votes 'yes' in the referendum next year, then the terms of our continuing membership of the EU would be required to be negotiated but that would be a process which happened from within the EU because it would be in everybody's interests to make sure that was the case."

She added: "For the UK government to argue that the UK will be a 'continuing state' and that an independent Scotland would have no rights betrays a near-colonial attitude to Scotland's position as a nation and gives lie to any suggestion that they see Scotland as an equal partner in the UK.

"The reality is that there is neither a settled international legal position nor any consistent precedent in these matters. [The] fact is that international precedents – even those cited by the UK government – prove the point that these are matters to be settled, not by law, but by sensible and mature negotiation that reflect the particular circumstances of the countries involved."