The Harper government's most recent attempt at Senate reform has been declared unconstitutional in a stinging court ruling rendered Thursday.

The Quebec Court of Appeal has released an opinion that the federal government had no right, under Bill C-7, to create Senate elections and set term limits without seeking provincial approval.

It says the fathers of Confederation considered the role and function of the Senate in great detail, and the conditions they drew up were essential to uniting the provinces under one country.

"The transcript of the pre-Confederation conferences shows that the founding fathers discussed the role and composition of the Senate at length," the 20-page ruling said.

"There is no doubt that this institution was a fundamental component of the federal compromise in 1867."

The court even refers to Canada's first prime minister, John A. Macdonald, being dead-set against the idea of elected senators to avoid having the new parliament resemble the Legislative Council of the old parliament of pre-Confederation Canada.

Now if the Harper government wants to reform the Senate, the court says, it needs to get approval from at least seven provinces holding half the country's population.

The government's Bill C-7 would have set nine-year term limits for senators, and created elections in provinces that wanted them.

The court said such a patchwork approach to elections was also in contradiction to the desires of Canada's constitutional framers.

In any case, the federal reform is already on hold amid intense debate over the nature of the upper chamber, which is currently being rocked by a spending scandal.

Supreme Court reference

The Conservatives have drawn up a reference of their own — this one to the Supreme Court of Canada, which will hold hearings on the Senate later this year.

In a statement Thursday, Pierre Poilievre, the minister of state for democratic reform, said the government is waiting on that Supreme Court opinion to give it an "legal instruction manual" on how to proceed with Senate reform.

"We continue to believe the status quo in the Senate of Canada is unacceptable. The Senate must be reformed or, as with its provincial counterparts, vanish. The government will proceed upon receiving the advice of the Supreme Court," Poilievre said in the statement.

The provincial-court battle, which ended with today's 20-page ruling, began when the previous Charest government filed a reference motion in May 2012 with the Quebec Court of Appeal, seeking an opinion on the legality of C-7.

It argued that the bill was unconstitutional, that it threatened to affect the functioning of Canadian federalism, and that it would harm certain regions of the country.

The court replied, in its verdict, that it's in no position to comment on the usefulness of Senate reform, or abolition — which are political matters.

It said it's only responding to questions about the constitutional rules for amending it. And under those rules, the federal reforms were a no-go.

"It follows from the principle of supremacy of the Constitution that political actors must comply with its text and its spirit. They cannot circumvent it on the pretext that the constitutional amending process is complex or demanding," Thursday's ruling said.

"To do so otherwise would disregard the principles of federalism, constitutionalism and the supremacy of law."

Quebec said it cannot support Senate reform unless the provinces are consulted, because such profound changes to the country's institutions shouldn't happen with a simple piece of legislation.

Senate elections would create a new dynamic in Canada's Parliament, where two chambers could suddenly compete over legislation and each claim democratic legitimacy.

The Supreme Court of Canada is to hold hearings on the proposed reforms in mid-November. A written opinion could take months.

The Quebec government has said it hopes the appeal court ruling could be used during this exercise.

If so, opponents of Harper's reform plan will now be armed with lines from the Quebec legal opinion, such as the following:

"Bill C-7, if it had been adopted, would have been unconstitutional without the agreement of the majority of the provinces pursuant to subsection 38(1) of the Constitution Act, 1982, since its true nature was to amend the method of selection of senators and the powers of the Senate without having respected the applicable amending procedure. In reality, Bill C-7 attempted to circumvent that procedure."

Quebec's Marois government is pleased with the court finding.

Justice Minister Bertrand St-Arnaud said the province will continue to oppose federal government attempts to act unilaterally in this matter.

"Ottawa cannot act alone in reforming the Senate," St-Arnaud said.