The B.C. Teachers' Federation has won a landmark decision on negotiating class size and composition in the Supreme Court of Canada.

Canada's top court provided a surprise verbal ruling a few hours after a hearing into the case started Thursday morning.

"It was sense of jubilation, there was cheering," said BCTF President Glen Hansman, who was in the courtroom in Ottawa. "We are very happy for our members and to resolve this once and for all."

Not expected until the spring

The BCTF was not expecting the court to rule until next spring.

The ongoing dispute dates back to 2002, when the province used legislation to strip teachers of their right to bargain class size and composition. The union says the province will now have to provide resources for class size and composition that date back to levels from when the legal dispute began.

"What that is going to look like in terms of timelines and operationally, we are going to have to talk about that. We were truly not expecting a decision here today," said Hansman.

"We will definitely be in conversations with the province because ... we need to get those teachers back into schools now."

Government hoping to get negotiations started quickly

The quick decision caught the province and many other observers off guard. Finance Minister Mike de Jong said his government is looking forward to starting negotiations with the BCTF on class size and composition.

The teacher's federation says the province will need to pay an additional $250 to $300 million a year to get back to 2002 staffing levels. The province says it is not able to provide those estimates yet.

"Over the course of the discussion with the BCTF, we will get a better sense of what the costs are and we will be in a position to incorporate it into our budgeting decisions for February," said de Jong.

"I believe it is in everyone's interest to negotiate in a way that looks after the best interest of the students and is minimally disruptive."

NDP Leader John Horgan said the court's ruling today is proof the Christy Clark government deliberately tried to provoke a strike with B.C. teachers for political gain, while leaving children under-supported in overcrowded classrooms.

"After 14 years of acrimony, after 14 years of disrespecting classrooms, the end of the road is here for Christy Clark and her disrespecting classrooms," said Horgan.

Legal battle ongoing for more than a decade

Bill 22, which the government passed in 2012, similarly blocked teachers from negotiating class size and composition.

The BCTF challenged the constitutionality of that legislation, saying it is "virtually identical to the legislation previously declared unconstitutional by the Supreme Court of British Columbia."

The union won the case in B.C. Supreme Court, but it was overturned on appeal.

The Supreme Court of Canada is the definitive decision on the issue.

"We were right. Government should not have done that back in 2002 and it's pretty amazing for the Supreme Court of Canada to agree with that and to issue that decision in the room right when we were sitting there," added Hansman.