The stars seemed aligned for supporters of gay marriage. They had Maine's governor, legislative leaders and major newspapers on their side, plus a huge edge in campaign funding. So losing a landmark referendum was a devastating blow, for activists in Maine and nationwide.
In an election that had been billed for weeks as too close to call, Maine's often unpredictable voters repealed a state law Tuesday that would have allowed same-sex couples to wed. Gay marriage has now lost in all 31 states in which it has been put to a popular vote - a trend that the gay-rights movement had believed it could end in Maine.
"Today's heartbreaking defeat unfortunately shows that lies and fear can still win at the ballot box," said Rea Carey, executive director of the National Gay and Lesbian Task Force.
With 87 percent of the precincts reporting, gay-marriage foes had 53 percent of the vote. They prevailed in many of Maine's far-flung small towns and lost by a less-than-expected margin in the state's biggest city, Portland.
"The institution of marriage has been preserved in Maine and across the nation," declared Frank Schubert, chief organizer for the winning side.
Attention will now turn to other states, including California - where Schubert was an instrumental strategist a year ago in the successful campaign to overturn cost-ordered same-sex marriage.
Gay-rights activists have been planning to go back to the ballot in California, either in 2010 or 2012, in another attempt to legalize gay marriage. But the Maine result was not the victory they had been hoping for to fire up their troops.
Brian Brown of the National Organization for Marriage, a conservative group that steered substantial funds to fight gay marriage in both California and Maine, was elated by Tuesday's result, saying it shows that "that even in a New England state, if the voters have a chance to have their say, they're going to protect and defend the commonsense definition of marriage."
At issue in the referendum was a law passed by Maine's Legislature last spring that would have allowed gays to wed. The law was put on hold after conservatives launched a petition drive to repeal it.
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.
Brown said "out-of-touch legislators" are a principal reason same-sex marriage has taken hold in New England.
"What we're saying is give us a chance to take our message to the people and let the people decide," he said. He also suggested that the outcome in Maine will give pause to lawmakers in New York and New Jersey, where gay-marriage legislation is pending.
Richard Socarides, who was an adviser on gay-rights issues in the Clinton administration, said the loss in Maine should prompt gay-rights leaders to reconsider their state-by-state strategy on marriage and shift instead to lobbying for changes on the federal level that expand recognition of same-sex couples.
In Maine, gay-marriage supporters conceded early Wednesday.
"We're in this for the long haul," said Jesse Connolly, manager of the pro-gay marriage campaign. "For next week, and next month, and next year - until all Maine families are treated equally. Because in the end, this has always been about love and family and that will always be something worth fighting for.
A similar note was sounded by Democratic Gov. John Baldacci, who signed the bill into law last May and spoke out in defense of the law.
"If we don't get to the top of the mountain tonight, we've made a significant stride. And we're going to get there," he said late Tuesday. "We will get to the top of the mountain."
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.
Stand for Marriage 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. That was the same theme used to persuade Californians to reject gay marriage.
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.