An Ontario court has ruled that the provincial government cannot proceed with the privatization of Hydro One.

The decision short-circuits the biggest initial public offering in Canadian history.

The surprise decision came after the Communications, Energy and Paperworkers Union of Canada and the Canadian Union of Public Employees went to court to try to stop the sell off. The unions want Ontario’s energy board to hold public hearings into the matter.

The Hydro One IPO was expected to raise about $5 billion for the Ontario government.

In early February, the province picked BMO Nesbitt Burns, Goldman Sachs & Co. and RBC Capital Markets as the lead underwriters for the IPO. National Bank Financial was selected as an advisor to Hydro One on the offering.