The court case followed a motion of no-confidence in the prime minister being defeated under a technicality of the rules as interpreted by the speaker.
Former prime minister Sato Kilman, who is now in the opposition, said the judge had ruled an absolute majority in parliament was 26, so the opposition won the case.
But the judge had stayed the case until 3pm on Monday to allow any appeal.
"We are glad, because we believed that we were right from the start, and that is why we lodged the application to the court," Kilman said.
Earlier this month the opposition, in seeking to remove Prime Minister Ishmael Kalsakau, won 26 votes in the 52-member House, while the government got 23 votes.
There was one abstention, from the speaker; one seat is vacant and one is empty due to that MP getting medical treatment overseas.
Vanuatu's constitution states that an absolute majority is needed to oust a prime minister and this has been interpreted to mean 27 MPs in the 52-member parliament.
Kalsakau said there was legal precedent to support this position.
In the judgment released on Friday, the judge said the court "concludes that the actual number of members of Parliament when this vote was taken is the relevant number on which an absolute majority should be based".
"It is the view of this court that the applicants have shown that their Constitutional rights, as set out in the application filed on 17th August 2023, have been infringed by the 1st respondent," the judgment said.
"They are entitled to relief sought."
It also said an order would be issued about that relief, but the order would include a stay to allow an appeal before any further steps are taken to enforce the order.
Supreme Court has just ruled that the vote of 26 MP's to oust the PM last week was valid and that the PM was voted out by an absolute majority of 26 in a Parliament with 51 members. So we are still only in Government due to a stay order granted to allow us time to appeal.
— Ralph Regenvanu (@RRegenvanu) August 25, 2023
Cathy Solomon, 64, who lives in Port Vila, said the majority of people in Vanuatu were suffering because of "unfair and sad" politicians who were only thinking of self preservation.
She said the country's politicians had failed in their purpose as elected representatives of the people.
She said it was time for more women to get into parliament so they could challenge and change Vanuatu's precarious politic situation.
Hendon Kalsakau, 65, a chief of the Coconut Tribe on Ifira island, said the situation was "affecting deeply" the Ni-Vanuatu people.