London's High Court ruled that the UK parliament has to approve the government's plans to exit the European Union before Prime Minister Theresa May can invoke Article 50, the formal process of leaving the EU.
The ruling, against which the government was given the right to appeal to the Supreme Court, has thrown May's plans to leave the EU into chaos.
A group of private citizens, led by financial consultant Gina Miller, had sought a judicial review of the government's plans to invoke Article 50 in March without consulting parliament.
May had said she planned to invoke Article 50 using an ancient power called the Royal Prerogative, but the judges ruled that parliament is sovereign.
Liam Fox, the International Trade Minister who was a leading campaigner for Britain to leave the EU, told the BBC: "The government is disappointed by the ruling. The country voted to leave in a referendum sanctioned by parliament."
He said the government would consider carefully its next step.
The pound, which had slumped to its lowest level in 30 years after the referendum result, rose sharply from 1.22 U.S. dollars to 1.24 on news of the ruling.