OTTAWA -- The Supreme Court of Canada has struck down as unconstitutional a Saskatchewan law that prevents public sector employees from striking.

By a 5-2 majority, the high court granted an appeal by the Saskatchewan Federation of Labour of the province's controversial essential services law that restricts who can strike.

The ruling will affect public service unions in provinces across the country. Last April, Nova Scotia enacted its own essential services law for health care workers, joining Newfoundland and Labrador and British Columbia as provinces that have essential services laws.

The Supreme Court also gave Saskatchewan one year to enact new legislation.

After winning power in 2007, the Saskatchewan Party introduced the new law, which says employers and unions must agree on which workers are deemed essential and cannot legally strike.

If the two sides can't agree, the government gets to decide who is an essential worker.

Writing for the majority, Justice Rosalie Abella said that power violated section 2(d) of the Charter of Rights and Freedoms, which protects freedom of association.

The two dissenting justices, Richard Wagner and Marshall Rothstein, said that enshrining the right to strike restricts the government's flexibility in labour relations.

The Saskatchewan law came after some high-profile labour unrest in Saskatchewan, including a strike by thousands of nurses in 1999 and another by highway workers and correctional officers in late 2006 and early 2007.

Court challenges began in 2008 after the law was enacted, and the Regina Court of Queen's Bench struck it down as unconstitutional in February 2012.

The court did uphold the principle of essential services and gave the government 12 months to fix the law.

The Saskatchewan Court of Appeal overturned the lower court ruling in 2013, so the labour federation appealed to the Supreme Court.

The Supreme Court has now reversed that appeal.

"Given the breadth of essential services that the employer is entitled to designate unilaterally without an independent review process, and the absence of an adequate, impartial and effective alternative mechanism for resolving collective bargaining impasses," wrote Abella, "there can be little doubt that the trial judge was right to conclude that the scheme was not minimally impairing."

Wagner and Rothstein disagreed.

"The statutory right to strike, along with other statutory protections for workers, reflects a complex balance struck by legislatures between the interests of employers, employees, and the public," they wrote in their dissent.

"Providing for a constitutional right to strike not only upsets this delicate balance, but also restricts legislatures by denying them the flexibility needed to ensure the balance of interests can be maintained."

Today's ruling comes after just two weeks after the Supreme Court's landmark labour relations ruling in a case involving rank and file officers of the RCMP.

The Supreme Court overturned a previous ruling of its own from the 1990s which upheld an exclusion that barred the Mounties from forming unions like federal public servants, who gained the right to collective bargaining in the late 1960s.

The ruling did not explicitly state that RCMP members have the right to form a union, but the justices effectively cleared a path to that possibility. As with today's ruling, the high court gave the federal government one year to create a new labour relations framework with the RCMP.

The RCMP ruling did not address the right to strike.