Boris Johnson's decision to suspend Parliament has been ruled "improper" and "unlawful" by three senior Scottish judges, who concluded it had been done with "the purpose of stymying Parliament".
The judges at the Court of Session in Edinburgh said the prorogation was therefore "null and of no effect".
The Government said it is "disappointed" by the decision and would be appealing to the UK's Supreme Court.
A group of around 70 parliamentarians had appealed against an earlier ruling by a judge that the Prime Minister's prorogation was lawful.
Judge Lord Doherty dismissed the challenge at the Court of Session last Wednesday, saying it was for politicians and not the courts to decide.
But three judges at the Inner House, the supreme civil court in Scotland, disagreed with Lord Doherty's ruling on Wednesday.
It continued: "All three First Division judges have decided that the PM's advice to the HM the Queen is justiciable, that it was motivated by the improper purpose of stymying Parliament and that it, and what has followed from it, is unlawful."
It went on: "The Court will accordingly make an Order declaring that the Prime Minister's advice to HM the Queen and the prorogation which followed thereon was unlawful and is thus null and of no effect."
- Joanna Cherry QC MP (@joannaccherry) September 11, 2019
At the hearing, Judge Lord Carloway told the court: "We are of the opinion that the advice given by the Government to her majesty the Queen to prorogue parliament was unlawful and that the prorogation itself was unlawful."
He referred the matter to the UK Supreme Court for resolution.
Campaigners said their understanding is that Parliament can now reassemble if it so wishes.
The ruling comes a day after the prorogation took place in the early hours of Tuesday, with Parliament now suspended for five weeks.
The campaigners included SNP MP Joanna Cherry QC, Liberal Democrat leader Jo Swinson, Labour MP Ian Murray and anti-Brexit barrister Jo Maugham, of the Good Law Project.
Ms Cherry tweeted: "Huge thanks to all our supporters & our fantastic legal team who have achieved the historic ruling that #prorogation is #unlawful #Cherrycase #Brexit #StopTheCoup."
Mr Maugham tweeted: "We have won. Appeal begins in the Supreme Court on Tuesday. We believe that the effect of the decision is that Parliament is no longer prorogued.
"I have never been able to contemplate the possibility that the law could be that our sovereign Parliament might be treated as an inconvenience by the Prime Minister. I am pleased that Scotland's highest court agrees. But ultimately, as has always been the case, it's the final arbiter's decision that matters.
"We will convene again in the Supreme Court next week."
Shadow Brexit secretary Keir Starmer said the court ruling was "huge", and vindicated Labour's efforts to stop Parliament being shut down.
Speaking at the TUC Congress in Brighton, he said: "I need to get back to Parliament, to see if we can reopen the doors and hold Johnson to account.
"The Prime Minister was not telling the truth about why he was doing it. The idea of shutting down Parliament offended everyone across the country, and then they felt they were not being told the truth."