PORTLAND, Maine — Maine voters repealed a state law Tuesday that would have allowed same-sex couples to wed, dealing the gay rights movement a heartbreaking defeat in New England, the corner of the country most supportive of gay marriage.

Gay marriage has now lost in every single state — 31 in all — in which it has been put to a popular vote. Gay-rights activists had hoped to buck that trend in Maine — known for its moderate, independent-minded electorate — and mounted an energetic, well-financed campaign.

With 87 percent of the precincts reporting, gay-marriage foes had 53 percent of the votes.

"The institution of marriage has been preserved in Maine and across the nation," declared Frank Schubert, chief organizer for the winning side.

Gay-marriage supporters refused to concede, holding out hope that that the tide might turn as the final returns came in.

"We're here for the long haul and whether it's just all night and into the morning, or it's next week or next month or next year, we will be here," said Jesse Connolly, manager of the pro-gay marriage campaign. "We'll be here fighting. We'll be working. We will regroup."

At issue was a law passed by the Maine Legislature last spring that would have legalized same-sex marriage. The law was put on hold after conservatives launched a petition drive to repeal it in a referendum.

The outcome Tuesday marked the first time voters had rejected a gay-marriage law enacted by a legislature. When Californians put a stop to same-sex marriage a year ago, it was in response to a court ruling, not legislation.

Five other states have legalized gay marriage — starting with Massachusetts in 2004, and followed by Vermont, New Hampshire, Connecticut and Iowa — but all did so through legislation or court rulings, not by popular vote. In contrast, constitutional amendments banning gay marriage have been approved in all 30 states where they have been on the ballot.

"Our relationship is between us," said Carla Hopkins, 38, of Mount Vernon, with partner Victoria Eleftherio, 38, sitting on her lap outside a hotel ballroom where gay marriage supporters had been hoping for a victory party. "How does that affect anybody else? It's a personal thing."

The contest had been viewed by both sides as certain to have national repercussions. Gay-marriage foes desperately wanted to keep their winning streak alive, while gay-rights activists sought to blunt the argument that gay marriage was being foisted on the country by courts and lawmakers over the will of the people.

Had Maine's law been upheld, the result would probably have energized efforts to get another vote on gay marriage in California, and given a boost to gay-marriage bills in New York and New Jersey.

Earlier Tuesday, before vote-counting began, gay-marriage foe Chuck Schott of Portland warned that Maine "will have its place in infamy" if the gay-rights side won.

Another Portland resident, Sarah Holman said she was "very torn" but decided — despite her conservative upbringing — to vote in favor of letting gays marry.

"They love and they have the right to love. And we can't tell somebody how to love," said Holman, 26.

In addition to reaching out to young people who flocked to the polls for President Barack Obama a year ago, gay-marriage defenders tried to appeal to Maine voters' pronounced independent streak and live-and-let-live attitude.

The other side based many of its campaign ads on claims — disputed by state officials — that the new law would mean "homosexual marriage" would be taught in public schools.

Both sides in Maine drew volunteers and contributions from out of state, but the money edge went to the campaign in defense of gay marriage, Protect Maine Equality. It raised $4 million, compared with $2.5 million for Stand for Marriage Maine.

Elsewhere on Tuesday, voters in Washington state voted on whether to uphold or overturn a recently expanded domestic partnership law that entitles same-sex couples to the same state-granted rights as heterosexual married couples. With half the precincts reporting, that race was too close to call.

In Kalamazoo, Mich., voters approved a measure that bars discrimination based on sexual orientation.

Among other ballot items across the country:

In Ohio, voters approved a measure that will allow casinos in Cleveland, Columbus, Cincinnati and Toledo. Four similar measures had been defeated in recent years, but this time the state's reeling economy gave extra weight to arguments that the new casinos would create thousands of jobs.

Maine voters defeated a measure that would have limited state and local government spending by holding it to the rate of inflation plus population growth. A similar measure was on the ballot in Washington state.

Another measure in Maine, which easily won approval, will allow dispensaries to supply marijuana to patients for medicinal purposes. It is a follow-up to a 1999 measure that legalized medical marijuana but did not set up a distribution system.

The Colorado ski town of Breckenridge voted overwhelmingly to allow adults to legally possess small amounts of marijuana.

Copyright 2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.