Three other states — Washington, Maryland, and Minnesota — also had same-sex marriage questions on the ballot in Tuesday’s election.

News of the vote was met with jubilant cries at the ­Holiday Inn by the Bay in ­Portland, where hundreds of supporters of the ballot initiative gathered to await results.

Before Tuesday, no state had approved gay marriage through a popular vote, rather than with a court decision or a legislative act.

Three years ago, the same initiative failed in Maine by a narrow margin: Fifty-three percent of voters decided to nullify a gay marriage bill passed by the Legislature earlier that year.

Since then, gay marriage supporters, led largely by the group Mainers United for Marriage, have waged a campaign to convince voters across the state to support the initiative.

They were met by an ­intense advertising campaign from groups such as Protect Marriage Maine, which argued that same-sex marriage would hurt Maine’s communities.

Supporters of the same-sex marriage initiative anticipated that the vote would come out in their favor because of the larger numbers of young voters who were attracted to the polls by the presidential election.

Perhaps no family better ­exemplified Maine’s complex perspective on the issue than the Grants, who live in Gray, a town about 30 minutes north of Portland.

Alena Grant, 20, said that her Christian upbringing led her to vote in favor of the same-sex marriage initiative. “I believe everybody ­deserves to be happy,” she said.

Her father, who declined to give his first name for fear of negatively affecting his business, voted no.

“I have nothing against them, and I have nothing against giving them civil unions and equal benefits,” he said.

“But they don’t, or can’t, procreate, and so they can’t spread the word of God, and that, to me, is what marriage is all about. I don’t condemn them for it.”

And Alena’s mother?

She was undecided right up until the time she reached the ballot box.

“In the end,” Leni Grant said, “I did vote yes.”

“I won her over!” Alena ­exclaimed.

“You didn’t,” she said matter of factly.

“But we have wonderful friends who are gay, and I think they deserve many things in life, and one of those things is happiness.”

“As for the biblical part of it,” she continued, “that decision is up to God.”

A 74-year-old Gray resident, who declined to give her name out of fear of offending family members, voted against the referendum. It was a painful decision, she said.

“My nephew is gay. He and his partner had a beautiful ceremony. To me, they’re married, but not in the eyes of the law,” the woman said as she walked out of the downtown polling station in Newbegin Hall.

“I figure they can all do something like that. It was a tough situation for me, but that’s my belief and I can’t change that.”

At the Howard C. Reiche Community School in liberal-leaning Portland, many voters who were exiting the polls seemed in favor of approving the question.

“It’s time, and I think a lot has happened in the last three years,” said Alison Smith, 57, a Portland resident. “More people understand that this is a fundamental question of equality.”

Smith said she believes same-sex marriage supporters were more effective with their get-out-the-vote efforts this year than in 2009.

“People thought it was a slam-dunk, they assumed it was going to pass, and then they didn’t bother to show on Election Day,” Smith said.

Erin Daly, 25, is a member of the Maine Republican Party’s state committee who said she would vote no on Question 1. She said she believes gays and lesbians have the right to marry, but with her self-described libertarian leanings, her vote was meant to register a protest against government regulation of any kind of marriage.