Maine voters on Tuesday appeared likely to overturn a state law allowing same-sex marriage, following a heated campaign that polarized the state and drew national attention.

PORTLAND, Maine — Maine voters on Tuesday appeared likely to overturn a state law allowing same-sex marriage, following a heated campaign that polarized the state and drew national attention.

Opponents of the law held a widening lead in unofficial returns, although neither side had claimed victory in the latest battle over whether to let gay couples marry. A year ago, Californians voted to pass a constitutional amendment banning same-sex marriage.

With 66 percent of Maine's 605 precincts reporting, according to tallies compiled by the Bangor Daily News, opponents of gay marriage led by 51.7 percent, while those seeking to uphold the state's same-sex law had 48.2 percent of the votes counted.

If the law is repealed, Maine will join more than 30 other states that have rejected gay marriage at the ballot box.

Same-sex unions are recognized in five states — Connecticut, Iowa, Massachusetts, New Hampshire and Vermont — as a result of judicial rulings or legislative action.

One other state is considering a related issue this year. Voters in Washington will decide whether to extend the same legal rights to registered domestic partners that married couples enjoy.

Marc Mutty, chairman of Stand for Marriage Maine, which sought to overturn the marriage law, said the vote appeared to signal a "victory for traditional marriage."

"This has never been about gay rights," he said. "It's about marriage, and this is reaffirmation by the people of Maine that marriage between men and women is special and unique."

Earlier, gay-rights supporters were hopeful of victory when state officials reported that voter turnout appeared unusually heavy on a warm and sunny election day. Officials had to print extra ballots in some areas to meet the demand.

"That's great for us," said Mark Sullivan, spokesman for No on 1/Protect Maine Equality, the coalition that is seeking to allow same-sex partners to marry. "It means we succeeded in reaching younger people and others who don't always vote."

The optimism was palpable several hours later, when more than 1,500 gay-rights supporters packed a hotel ballroom in downtown Portland. "It's early, but I'm very encouraged by the results we're seeing," Gov. John Baldacci told the cheering crowd.

Across town, a few dozen supporters of the repeal movement sat quietly at mostly empty tables in another ballroom. The mood was considerably more subdued.

"Regardless of the outcome tonight, we fought the good fight," Mutty told the gathering. "We have nothing to be ashamed of."

But the moods shifted when an early lead by gay-marriage supporters evaporated in the steady trickle of votes from across the state.

Amy Fried, a political scientist at the University of Maine in Orono, said the state Legislature almost certainly would pass another gay marriage law if voters rejected the statute. If the law is upheld, she added, gay activists around the country would look for lessons in what worked and why.

"But there are some unique characteristics in Maine," Fried said. "It's a fairly secular state, with strong libertarian leanings even among conservatives. And Mainers really despise negative campaigning. That doesn't necessarily translate from one state to another."

Rea Carey, executive director of the nonprofit National Gay and Lesbian Task Force, said a vote to uphold the law in Maine would bolster efforts to pass similar laws in New York, New Jersey and other states.

"It will be the first time that we have won on marriage equality, and that will not go unnoticed," she said.

A loss, she added, would not stop the effort. "It means we have more work to do," she said. "We'll learn from it and move on."

Voters have been bombarded for weeks with TV ads, mailings, phone calls, canvassers and get-out-the-vote efforts, and both sides deployed thousands of volunteers. Yard signs lined some roads, poking out of a blanket of wildly hued autumn leaves on Tuesday.

California's bitter fight last year over Proposition 8 set the stage for the high stakes rematch here.

Gay-rights activists organized a fierce campaign last spring to allow same-sex marriages. Baldacci, a Democrat, initially refused to support the proposal, but he signed it in May after it passed the Legislature.

Opponents immediately began collecting signatures to call a ballot initiative to repeal the law before it could go into effect.

Though the battle had a distinctly Maine flavor, both sides relied heavily on activists, money and other resources from out of state. Supporters of gay marriage raised about $4 million, while the repeal groups have raised $2.6 million.

The anti-gay marriage group sought to attract the votes of Catholics, members of evangelical churches and other social conservatives in the small towns that pepper the state's less-affluent northern and western counties.

Supporters of the marriage law drew their strongest support in Maine's southern cities and suburbs, where political attitudes are more liberal.

Stand for Marriage Maine hired the same consulting firm that ran the Proposition 8 campaign against same-sex marriage, Schubert Flint Public Affairs, based in Sacramento, Calif., to supervise strategy and advertising.

Using ads similar to those aired last year in California, the group warned in a spot broadcast Monday night: "Don't be fooled. Gay marriage will be taught in Maine schools" if the law is not repealed.

Baldacci and state education officials had insisted for weeks that nothing in the new law would require teachers to discuss marriage in schools.