ST. PAUL, Minn. (AP) — Minnesota is set to become the 12th U.S. state where gay couples can get married after a final legislative vote Monday that will let the weddings start on Aug. 1.

Democratic Gov. Mark Dayton has pledged to sign the bill, and scheduled a ceremony at 5 p.m. Tuesday on the front steps of the Capitol in St. Paul to do so.

Minnesota is now the first state in Midwest to legalize gay marriage by legislative vote, and the third nationwide in just 10 days, joining Rhode Island and Delaware. Thousands of gay marriage supporters thronging the Capitol erupted into deafening cheers after the Senate’s 37-30 vote; the House passed it last week on a 75-59 vote.

“Members, God made gays,” Sen. Ron Latz, a Democrat from a suburb of Minneapolis, said during the Senate’s emotional four-hour debate. “And God made gays capable of loving other people. So who are we to quarrel with God’s intentions?”

The gay marriage issue shifted quickly in Minnesota, with the Legislature’s vote coming a little more than six months after voters defeated an amendment that would have banned gay marriage in the state constitution. The groups that led the campaign against the amendment swiftly turned to pushing for legalizing same-sex marriage, an effort aided when Democrats captured full control of state government in November.

Only one Republican senator, Branden Petersen of suburban Andover, voted for the bill. Three Democrats from rural districts voted against it.

Republican opponents said the bill alters a centuries-old understanding of marriage as a societal building block that benefits children.

“Forcing others to give you your rights will never end well,” said Sen. Dan Hall, a Republican and a pastor. “It won’t give you the recognition you desire.” Hall said gay marriage supporters have told him he’s on the wrong side of history but, he said, “the truth is I’m more concerned about being on the right side of eternity.”

But supporters, too, cited religious faith and with relationships with gay family members and friends in shaping their vote for the bill. Many spoke of the benefits of their own marriages.

“I could never and I would never deny the kind of recognition and all the other positive things I get out of my marriage with my husband, to anyone else,” said Sen. Vicki Jensen, a Democrat from the southern Minnesota city of Owatonna.

Republican opponents argued that the bill’s provisions meant to protect religious freedom were insufficient, raising concerns it could force merchants in the wedding industry to accept business from gay couples even if the merchants object to such marriages.

“We must respect religious freedom at the same time as we advance rights,” said Sen. Carla Nelson, R-Rochester. “This bill does not do that.”

Still, with passage looking inevitable Monday, vocal and visual opposition was muted. Don Lee, of Eagan, placed a tombstone on the Capitol lawn with the words “R.I.P. MARRIAGE 2013.”

“The legislation being passed today is the end of marriage as we know it in Minnesota,” Lee said. “It’s a transformation from a forward-looking sacrificial institution to one focused on adult desires.”

Supporters and opponents were close to evenly matched during the House debate, but Monday was dominated by gay marriage backers.

They taped blue and orange hearts on the Capitol steps, creating a path into the building for lawmakers with the signature colors of their movement. In the rotunda, demonstrators sang songs including “Over the Rainbow,” ”Going to the Chapel” and “The Star-Spangled Banner.”

Like Thursday, there was a stepped-up security presence. State troopers were posted inside and out, and areas of the building were cordoned off to allow lawmakers to move freely amid the expected throngs.

St. Paul Mayor Chris Coleman ordered the Wabasha Street Bridge near downtown festooned in rainbow-striped gay pride flags, and temporarily renamed it the “Freedom to Marry Bridge.” He also proclaimed it “Freedom to Marry Week.”

Minnesota’s most famous opponent of gay marriage also weighed in. U.S. Rep. Michele Bachmann, an ardent supporter of banning gay marriage when she served in the state Senate, released a statement expressing disappointment in a vote she said “denies religious liberty to people who believe in traditional marriage.”

But gay couples were already thinking about wedding planning. Jeff Moses and his legal husband, John Westerfield-Moses, of Minneapolis, were married in Iowa four years ago, when the state’s Supreme Court ruled to allow it.

Their anniversary is Aug. 23, a few weeks after a Minnesota law would take effect, and the couple is considering having a marriage ceremony here, too.

“Any excuse for a party,” Jeff Moses said.

“It was bound to happen,” John Westerfield-Moses added. “It was a train that was coming.”

Jessica Flatequal and Maria Bevacqua, a lesbian couple from Mankato who have been together for a decade, were jubilant after the vote, as supporters spilled out of the front of the Capitol.

“We’re excited to become equal citizens under the law,” said Bevacqua, a professor at Minnesota State University-Mankato. Asked whether they would get married, both women laughed.

“Well, neither of us proposed today,” Flatequal said. “But now that’s going to be part of the discussion. It’s weird, actually.”

(© Copyright 2013 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)