WINNIPEG, Manitoba (Reuters) - A Canadian court ruled on Friday that a federal carbon-pricing plan does not violate the constitution, marking a victory for Prime Minister Justin Trudeau over one of his trademark policies ahead of the October national election.

In a 3-2 decision, the Saskatchewan Court of Appeal rejected a challenge from the conservative provincial government, which argued the tax could not be imposed by Ottawa.

Trudeau, citing international commitments on global warming, four years ago campaigned on a promise to introduce a plan to fight climate change, and on April 1, he slapped a federal tax on the four provinces that had refused to introduce their own carbon-reduction plans.

Although Ottawa says the money collected from the tax will be returned to Canadians in the form of rebates, right-leaning parties portray it as a cash grab that will disproportionately penalize car-dependent Canadians living in the suburbs or in rural areas.

Saskatchewan’s premier, Scott Moe, said he would appeal the decision.

There are “strong grounds for appeal,” Moe told reporters after the decision, noting that it was “a very close, split decision”.

“Ultimately, the fate of the Trudeau carbon tax will be decided in the federal election this fall,” Moe said.

Ontario Premier Doug Ford is also challenging the carbon tax in court, as is the province of Manitoba. Oil-rich Alberta’s new Premier Jason Kenney has said he will scrap the local carbon levy that was created by his predecessor.

“We disagree with the narrow ruling by the majority that the federal government has the power to ensure a provincial minimum price on carbon, and will be joining Saskatchewan in their appeal to the Supreme Court of Canada,” Kenney said in a statement.

The Liberal government, on the other hand, welcomed the ruling.

“It is an issue of national concern. Pollution does not know any borders,” Environment Minister Catherine McKenna said.

Addressing provincial leaders who are fighting the national plan and Conservative Party leader Andrew Scheer, she added: “Will you stop blocking climate action and join us in fighting climate change?”