The Ontario government passed legislation Wednesday to repeal the province’s cap-and-trade system, putting the final nail in the coffin of a program Premier Doug Ford has long promised to scrap.

The bill was introduced in July but the final vote was delayed when an environmental group launched legal action against the government, alleging the province had flouted the Ontario’s Environmental Bill of Rights by failing to hold public consultations on the issue.

The government immediately launched public consultations on the bill, which wrapped mid-October. The results of that consultation have not yet been made public.

The legal action will still move forward, however, on allegations that the government also bypassed mandatory consultations on a regulation related to the cancellation of cap and trade.

Environment Minister Rod Phillips said Wednesday that the government was living up to its mandate by getting rid of cap and trade.

“It was costly, it was ineffective, it was killing jobs, it’s gone today,” he said.

Ford vowed to eliminate the system and fight Ottawa’s carbon pricing plan during the spring election campaign, arguing both were too expensive for residents and businesses.

His government has already cancelled most programs financed through cap-and-trade revenues, which include rebates for energy-efficient renovations, transit projects and a fund for school repairs.

Ontario’s cap-and-trade system aimed to lower greenhouse gas emissions by putting caps on the amount of pollution companies in certain industries could emit. If companies exceeded those limits they had to buy allowances at quarterly auctions or from other companies that came in under their limits.

The province made close to $3 billion from cap-and-trade auctions since the system was introduced by the Liberals last year.

Ontario’s fiscal watchdog recently said the cancellation of cap and trade will cost $3 billion in lost revenue over the next four fiscal years.

The Financial Accountability Office also said in its report that just over a billion dollars in cap-and-trade revenue has yet to be spent, though it expects the money will be used up by the costs of winding down the program and funding to green initiatives not cancelled by the province.

Under the Liberals, revenues generated through cap and trade were dedicated to green energy projects. The Progressive Conservatives, who called the revenues a “slush fund,” have not said what the money will be spent on.

“Where has the money gone? It came with a purpose attached to it, it was supposed to be used to reduce emissions,” said Liberal legislator Nathalie Des Rosiers.

“We need to know which programs will be supported, which programs will not be supported, which money is going to be given to compensate the corporations who have lost money, which money may be even used to pay for lawsuits that are no doubt going to attach to this government.”

Critics have also taken aim at the court battle the province is waging against Ottawa over the federal carbon tax for provinces that don’t have their own carbon pricing system, calling it a costly and futile exercise.

Opposition parties had expressed further concerns that the government could be on the hook for billions of dollars to compensate permit holders, but the Progressive Conservative government maintains it will spend up to $5 million in payouts to those companies.

The criteria for companies seeking to be reimbursed for costs incurred through the program are laid out in the legislation that passed Wednesday. The government has said only those that purchased more than they used while the program was still active, and were not able to recover those costs from consumers, will be eligible for compensation.

The legislation also protects the province from any potential litigation over the decision.

Ontario’s environmental watchdog recently criticized the government dismantling cap and trade without putting in an effective climate change program to replace it.

Phillips has promised to present a climate change plan this fall.

Greenpeace, the group pursuing legal action over the repeal of cap and trade, said Ontario would be worse off following the passing of the legislation.

“Doug Ford has killed a climate action plan that was successfully reducing pollution while preparing Ontario for the new green economy,” said Keith Stewart, the group’s senior energy strategist. “He may score some cheap political points, but my and everyone else’s kids will pay the price if we allow him to sit out the fight against climate change.”