ANNAPOLIS, JULY 2 -- An Anne Arundel County Circuit Court judge ruled today that opponents of Gov. William Donald Schaefer's plan to build two sports stadiums in Baltimore have the right to take the issue to Maryland voters in a statewide referendum, a move that could threaten the stadium construction and the city's chance to land a National Football League franchise.

But that's only Round One of this legal battle. Attorney General J. Joseph Curran Jr. immediately appealed the decision of Circuit Judge Raymond G. Thieme Jr. to the state's highest court, the Maryland Court of Appeals. Curran and stadium opponents expect the court to hear the case quickly, perhaps by the end of the month.

And although both sides agreed that Thieme's decision was only an interim step, it was a boost for stadium opponents, who have gathered more than 45,000 signatures to put the stadium issue on the November 1988 general election ballot.

"We're just tremendously ecstatic and grateful -- we're dancing in the streets," said Sen. Howard Denis (R-Montgomery), one of the leading stadium opponents. Denis and others worked with the Baltimore-based Marylanders for Sports Sanity in gathering the petitions necessary to bring the issue to referendum.

Curran said he has no plans to argue the case differently before the Court of Appeals, and said he still felt confident the higher court would rule that the stadium issue is not one that can be brought to a referendum.

"We're disappointed but this is only the first stage," Curran said as he arrived at the courthouse to begin the appeals process. "Now we {will} win in July rather than in June."

The state contended that the $201 million stadium plan -- in which the General Assembly picked Camden Yards near Baltimore's Inner Harbor as the site for the stadiums and came up with a financing plan for the project -- is one of the exceptions to referendum set up by the state Constitution. That exception is for any legislation that makes an appropriation of public funds for maintaining state government.

Thieme ruled that the exception was meant to keep referendums from interrupting the orderly workings of government. In this case, "the court is unable to find that any function of state government will be interrupted by referring {the stadium plan} to referendum."

He added that "provisions of constitutions authorizing direct popular participation in the law-making process should be liberally construed in favor of the people."

Thieme also said the financing plan advocated by the General Assembly left in question whether construction of the stadiums met the test of being a "primary function" of state government.

The plan is to issue state bonds, backed by leases and the proceeds from up to four special lotteries, but the legislature said that private financing proposals were preferred.

Thieme said it was "obvious" the legislature considered the stadium construction to "be primarily a private function."

"This court is convinced that had the Maryland General Assembly considered the acquisition and construction of these particular sports stadia 'primary functions' and thus 'imperative duties' of state government, it would have appropriated the requisite public funds in the budget bill or mandated a tax in a supplementary appropriation bill," Thieme wrote.

Schaefer was attending events on the Eastern Shore when Thieme's decision was announced and he could not be reached for comment. Curran said Schaefer was "upbeat" and confident the state would win on appeal.

Thieme's decision seemed to indicate that changes in the legislation could ensure that the project met the tests that would make it exempt from the referendum process. But aides and legislators said it was too early to talk about the possibility of a special session.

Denis said he would welcome one, perhaps to change the plan to build only a football stadium and renovate Memorial Stadium, or to find a site away from downtown Baltimore. But he said there is a "gut feeling" among Maryland voters that the current plan "is a bridge too far."

A recent poll by the Baltimore Sun found that 39 percent of the state's voters opposed the plan to build two new stadiums in Camden Yards, while 29 percent favored it. Voters in Baltimore viewed the project in about the same way as the rest of the state, and 81 percent of the voters felt the issue should be on a referendum.

Maryland Stadium Authority Chairman Herbert J. Belgrad said waiting for a decision until November 1988 could kill the city's chances of landing an NFL expansion franchise, because a committee to study the competing cities could be formed as early as the end of this year. He also said the referendum would stop the authority's negotiations with the Orioles on a long-term lease, necessary before the baseball stadium is to be built.

Curran said the state will go ahead with plans for the first special sports lottery, to be held July 13. If the stadium plan is placed on referendum, he said, the money raised would go to the general fund.