A group of politicians are attempting to overturn a court ruling that Boris Johnson's plan to shut down parliament ahead of Brexit is legal.
Government documents which suggest Boris Johnson agreed to suspend Parliament two weeks before making it public have been released to the media.
Lord Doherty said at the Court of Session on Wednesday that the PM had not broken any laws by asking the Queen to suspend Parliament for five weeks.
The memos emerged earlier this week during a failed legal challenge to the prime minister's plan.
The MPs and peers behind the legal challenge immediately appealed against his ruling.
The court has now agreed to a request by the BBC and other media organisations to release the documents.
The appeal is being heard by three judges from the court's Inner House.
They include a note sent to the PM on 15 August asking if he wanted to prorogue parliament from mid-September.
The prime minister announced on 28 August he wants the five-week shutdown - a process known as prorogation - to start next week ahead of a Queen's Speech on 14 October.
A handwritten tick and the word "yes" can be seen on the document.
The group of more than 70 largely pro-Remain politicians, headed by SNP MP Joanna Cherry, argue that Mr Johnson is exceeding his powers and attempting to undermine democracy by avoiding parliamentary scrutiny before the UK leaves the EU on 31 October.
The documents also include a note, said to have been handwritten by the prime minister on 16 August, which described the September session of Parliament as a "rigmarole introduced to show the public that MPs were earning their crust" and that he did not see "anything especially shocking about this proposition".
Lord Doherty rejected their claim, saying it was for Parliament and the electorate to judge the prime minister's actions rather than the courts.
Parts of the documents have been redacted, despite a request from lawyers representing the media organisations that they be released in full.
The judge said: "In my view, the advice given in relation to the prorogation decision is a matter involving high policy and political judgement.
The Prime Minister announced on 28 August that he wants to shut down Parliament for five weeks from next week.
"This is political territory and decision making which cannot be measured against legal standards, but only by political judgements.
The documents were released by a panel of three judges at the Court of Session in Edinburgh on Thursday.
"Accountability for the advice is to parliament, and ultimately the electorate - not to the courts."
They have been hearing an appeal by a group of MPs and peers who want the court to overturn a decision delivered by Lord Doherty earlier this week that the prime minister was not breaking the law by suspending Parliament for five weeks, ahead of a Queen's Speech on 14 October.
He said his opinion was therefore that there had been "no contravention of the rule of law" by the prime minister.
Lord Doherty added: "The power to prorogue is a prerogative power and the prime minister had the vires (powers) to advise the sovereign as to its exercise."
Ms Cherry, who is a QC, immediately said she believed Lord Doherty had "erred in law" in his opinion, and the Inner House agreed to hear an appeal.
It emerged during a hearing on Tuesday that Mr Johnson appeared to have approved a plan to shut down the UK Parliament two weeks before publicly announcing it.
The Court of Session heard that the prime minister was sent a note on 15 August asking if he wanted to prorogue parliament from mid-September. A tick and the word "yes" was written on the document.
A lawyer acting for the BBC has asked the court to release the government documents in the interests of open justice. The appeal hearing will consider the request.
Scotland's top law officer, the Lord Advocate James Wolffe, has also been given permission to speak during the hearing,
Responding to Lord Doherty's ruling on Wednesday, a UK government spokesman said: "As we have set out, the government needs to bring forward a strong domestic legislative agenda - proroguing Parliament is the legal and necessary way of delivering this.
"We welcome the court's decision and hope that those seeking to use the judiciary to frustrate the government take note and withdraw their cases."
What other legal challenges is the government facing?
On Thursday, the High Court in England will consider a judicial review request from Gina Miller, the businesswoman who successfully challenged the government over the triggering of the Article 50 process to start the Brexit countdown.
Ms Miller, who has been joined by former Prime Minister John Major, wants to challenge Mr Johnson's suspension of parliament.
And in Belfast, a judicial review against the government by a campaigner arguing that no deal could jeopardise the Northern Ireland peace process, is scheduled for 16 September.