A controversial bill aimed at protecting Quebec City's arena project was adopted by the provincial legislature Wednesday after months of acrimonious debate.

Bill 204 aims to pre-emptively block any potential lawsuit against the deal granting the Quebecor media empire control over the future arena.

The legislation declares that the agreement is perfectly legal and respects municipal contracting guidelines.

It was first introduced when a former city manager announced plans for legal action; he said the deal was illegal and circumvented the city's public-tendering process.

The deal would give Quebecor control of an estimated $400-million building.

In exchange, Quebecor would give the city $33 million cash down, just over $3 million more per year, 15 per cent of the arena's profits, and a pledge to use the building for community events.

The Parti Québécois was torn apart by divisions over Bill 204.

The issue led to the departure of five members this spring, including prominent ones who spent decades helping to build the party.

They said they felt morally uncomfortable supporting the bill.

The rash of departures created deeper existential angst within the sovereignty movement, with some breakaway Péquistes even creating a new political party.

But the legislation passed Wednesday with the support of most Péquistes and the governing Liberals. Only nine current PQ members opposed the bill, which was first introduced by one of their own.

The final vote saw 98 members of the 125-seat legislature support the legislation.

Quebecor is applauding the new law. It says the move helps set the stage for the return of NHL hockey, after a 16-year absence from the provincial capital.

"We now have all the necessary tools to reach the objective we set out to bring the Nordiques back to Quebec City," said Quebecor boss Pierre Karl Peladeau.

"The population of Quebec City and all hockey fans can count on our unwavering determination in our ongoing representations to the National Hockey League."

The league has never promised any expansion to Quebec and, in its statement Wednesday, Quebecor conceded any new arena would guarantee nothing.

But it calls the latest move a positive step.

The building construction will be paid for by provincial and municipal taxpayers.

A more accurate estimate of its price tag is expected to be determined by April; the $400 million estimate is only a preliminary guideline.

The Harper government, in the face of intense pressure for months, announced earlier this year that it would not be dedicating federal money to the project.

Prominent Péquiste Bernard Drainville voted against the bill. He expressed relief afterward that the party could finally put the issue behind it.

"We had some bruising debates," Drainville said. "Time will tell whether they will leave a mark. For now, let's just say these weren't the easiest debates because our values and deep convictions were at stake."

The city mayor, Régis Labeaume, said he expressed regret to the leadership of the Parti Québécois for all the troubles the bill had caused it.