Prime Minister Pierre Trudeau cleared a major legal hurdle today when Canada's highest court declared his plans to fashion a new constitution without the consent of the nation's 10 provinces to be within the law.

At the same time, however, the Supreme Court dealt him a potentially damaging political setback by ruling that while his constitutional plans were legal, federal traditions require consultation with the provinces.

The ruling was a landmark in the long and divisive debate on federal versus provincial powers, an issue comparable to states' rights in the United States. It came as key provincial governments, enjoying the new-found prosperity of oil and farm wealth, have dug in against central government claims on their riches.

The decision brought claims of victory from the Trudeau administration and from leaders of the provinces, laying the groundwork for further tensions and a possibly bruising confrontation between federal and provincial authorities.

The court, deciding one of the most important cases in the country's 114-year history, declared it was legal for Trudeau to set up a new constitution without seeking the consent of the country's 10 powerful provincial governors. The nine-member body voted 7-2 in favor of the Trudeau government on this.

But the court, in what was believed to be its first pronouncement on matters of historical -- as opposed to legal -- tradition, said there was an unwritten convention that under Canada's federal system the wishes of the provinces should be taken into account when altering the constitution. On this question, the court split 6-3 against the Trudeau government.

Furthermore, the court stated that it would be "unconstitutional in the conventional sense" for Ottawa to write a new constitution over the objections of Canada's provincial governments.

"I'm extremely pleased that on the legality question, we won," said Jean Chretien, the federal justice minister and acting government spokesman on this issue while Trudeau is on a state visit to South Korea.

"Fifty-four years of deadlock will finally be broken and Canada will have its own constitution," Chretien said. He added that he had spoken earlier to Trudeau by telephone and that Trudeau was "quite pleased" by the decision.

Trudeau said at a news conference in Seoul that his government probably would press ahead with its constitutional plans now that the court has ruled them legal. But he said Ottawa would "do so prudently, conscious of the magnitude of our enterprise."

He also held out the possibility of further negotiations with the provinces on the constitutional issue if provincial leaders indicated a willingness to make significant compromises.

This statement was taken by provincial leaders in Canada as a sign that the Liberal Party government might be willing to enter into another round of talks with the provinces. William Bennett, premier of the province of British Columbia and a spokesman for Canada's 10 provincial premiers, responded at a press conference tonight by inviting Trudeau to a federal-provincial conference Bennett would like to convene in the near future.

Bennett said earlier that the ruling was a victory for those opposing Trudeau's moves. Citing the court's conclusion that federal tradition in Canada requires the consent of the provinces for constitutional change, Bennett said, "This country has been built on tradition and convention, and that's the other part of the law that has built this country and guided this country."

Essentially, the dispute in Canada is between two different visions of the federation -- that of the federal government, which claims that Canada must have a strong central governing body to avoid becoming Balkanized and that of the provinces, who claim that only the devolution of more power to the provincial capitals can hold this regionally diverse country together. The debate took on new momentum last October, when, following the breakdown of negotiations with provincial leaders on the measures to be contained in a new governing charter, Trudeau announced that the federal government would devise its own constitutional package.

Canada's current constitution is the British North America Act, passed by Westminster in 1867. Trudeau declared his intention to ask Britain to transfer the act to Canada, along with with a bill of rights drawn up by the Trudeau government and a formula by which Ottawa and the provinces could vote on future amendments to the charter.

The provinces strongly objected, arguing among other things that the bill of rights in the Trudeau proposals would infringe on the hard-won rights the provincial governments hold under Canada's highly decentralized federal system.

Through last winter, the battle was waged in Parliament and in the courts, with eight of Canada's 10 provinces -- Ontario and New Brunswick excepted -- backing challenges to the federal government's proposals. This culminated in Trudeau's decision in April to put the case before the Supreme Court.

Progressive Conservative Party Leader and former prime minister Joe Clark, who has fought the constitutional package in Parliament for more than a year, today urged Trudeau to hold off and seek further consultations with the provincial premiers. Clark said that, based on the Supreme Court judgment, for Ottawa to do otherwise would "severely jeopardize" the nation's interests and would be "deeply destructive to the country."

The dissenting provinces have been gearing up for a massive reaction to the court decision that may include taking delegations to Britain to protest before the British Parliament, multimillion-dollar advertising campaigns in Canada to drum up public opposition to Trudeau's plans and the possibility that some provinces will go directly to the voters on the issue.

Perhaps most ominously, there have been reports that the government of Quebec Premier Rene Levesque, whose government is dedicated to taking the largely French-speaking province out of the Canadian federation, is considering a possible referendum or snap election on the constitutional issue.

With the Supreme Court decision rendered, the next step will be for Parliament next month to hold two final days of debate on the resolution containing Ottawa's constitutional proposals. After that the resolution will be sent to Westminster, where the British Parliament will be expected to vote on it in December.