A panel of three judges at the Court of Session ruled in favour of a cross-party group of politicians who challenged the prime minister's move, overturning an earlier ruling from the same court last week that Johnson had not broken the law.
MPs are not scheduled to return to Parliament until 14 October, when there will be a Queen's Speech outlining Mr Johnson's legislative plans.
After three years of Brexit crisis, British politics is in turmoil, with the prime minister blocked by parliament and an election or even a second referendum on the cards.
"The Lord President, Lord Carloway, decided that although advice to HM the Queen on the exercise of the royal prerogative of prorogating Parliament was not reviewable on the normal grounds of judicial review, it would nevertheless be unlawful if its objective was to stymie parliamentary scrutiny of the executive", the Judiciary of Scotland wrote in its summary of the opinion.
Jo Maugham, a lawyer involved in the Scottish case, said the government's appeal would begin next September 17.
He noted a separate legal challenge to prorogation brought at the High Court in London last week had failed.
Johnson, who was a figurehead for the Vote Leave campaign in the 2016 referendum, when 52 percent of voters backed Brexit, has rejected opposition complaints that he was undemocratically denying parliament the right to debate Brexit. He added, "It was to be inferred that the principal reasons for the prorogation were to prevent or impede Parliament holding the executive to account and legislating with regard to Brexit, and to allow the executive to pursue a policy of a no-deal Brexit without further parliamentary interference".
Judges at the Court of Session in Edinburgh said the government's action was illegal "because it had the objective of stymieing Parliament".
However, as the court gave no order for the suspension to be lifted, parliament remains prorogued for the time being.
Last week, his government lost control of Parliament to an informal coalition of the main opposition and Conservative rebels, who then passed a bill on Monday to block a "no-deal" Brexit within the current deadline.
"Court says prorogation was unlawful and null and void - so Parliament must be recalled immediately to allow the essential work of scrutiny to continue".
"We are disappointed by today's decision, and will appeal to the UK Supreme Court", a spokesperson said. "Proroguing Parliament is the legal and necessary way of delivering this", said a statement by 10 Downing Street.
Labour Party Brexit spokesman Keir Starmer said the court's ruling was "very rare and it's very strong".
"It's Tom's view - I don't accept it and I don't agree with it", Corbyn said. Ms Miller is appealing that decision in the Supreme Court.
Meanwhile, a hearing at the High Court in Belfast into the implications of a no-deal exit is continuing, with a campaigner for victims of the Troubles arguing that it could jeopardise the Northern Ireland peace process.