Downing Street had argued that executive powers gave the prime minister the right to withdraw from international treaties.
But a majority of the 11 judges agreed that withdrawing from the EU meant there would have to be changes to Britain's domestic laws and therefore parliament must be consulted.
- How is the government reacting to this decision?
The landmark ruling is a blow to Prime Minister Theresa May and a victory for Gina Miller, the lawyer who brought the case to court.
However, the government said Article 50 - the formal procedure for leaving the EU - would still be triggered by the end of March. Most law experts, given that the British High Court made the same ruling back in November, were expecting the decision.
"This has been the correct decision because it's not a political but a legal decision," says Alina Tryfonidou, a Professor in EU Law with the University of Reading. "It basically seeks to give power back to the parliament, in order to ensure that any rights that will taken away, will be by the parliaments, as they were orginally given by the parliament."
Brexit Minister David Davis said the government has already drafted an article that should be presented within days.
- What does this ruling changes in terms of process?
At first sight not much because no one expects the British parliament to block the UK from exiting the EU.
However the Labour Party and the Scottish National Party have said they will table amendments, which could potentially cause a delay.
"The very early indications is that Labour's most important amendments is that the British government should bring the deal to parliament for approval, before it actually signs it," says Dimitris Papadimitriou a Professor of Politics at the University of Manchester. "The Liberal Democrats have also made it clear that they want a second referendum. Whether these amendments will actually be upheld at the end, we don't know."
- Will the final deal be approved by parliament?
Once the UK triggers article 50, it will have two years to negotiate the terms of the divorce and a new relationship with the EU.
The result of those negotiations will most probably be put to parliament and the ruling gave the house more power over the final decision.
"The problem is that what Theresa May had said is that she would give final say to the parliament," explains Alina Tryfonidou. "Forgetting the judgement, parliament would have voted at the end of the process and that would have been a take-it-or-leave-it situation. What today's judgement has done is to give another opportunity for parliament to control the process."
- The Supreme Court also said devolved governments will have no say in the Brexit process. What does that mean?
It means Scotland, Northen Ireland and Wales won't be able to influence the government during the negociations.
The decision is seen by most experts as logical.
"There is a sense in which the decision to leave the EU was made in a UK-wide referundum. It didn't have conditions related to a majority in specific countries of the UK," explains Reuven Ziegler, a lecturer in law at the University of Reading . "I think politically this will make it even more challenging for the government to get what it wants, particularly in the case [Scotland] which voted 62 percent in favour of Remain."
That aspect of the ruling is a setback for Scottish First Minister Nicola Sturgeon, who hoped to influence the negotiations. Last week she said Theresa May intention of taking the UK out of the European common market made a second Scottish independence referundum more likely.
The ruling, however, is likely to be very unpopular with parts of the British public. The High Court ruling against the government in November attracted protests and criticism.
The Daily Mail tabloid reacted angrily by saying" the elite had showed their contempt for Brexit voters... and that Remain campaigners were "gloating".