ST. PAUL, Minn. (AP) - Spurring onlookers' cheers, the Minnesota Senate voted Monday to make gay marriage legal, putting the state on the brink of becoming the 12th to allow same-sex couples to marry. Gov. Mark Dayton immediately announced he would sign the legislation Tuesday.
    
The Senate vote of 37-30 came four days after the House passed the bill on a 75-59 vote. When the tally was announced after more than four hours of debate, a huge cheer erupted in the chamber and gallery, where spectators stood and applauded.
    
Minnesota will become the first state in the Midwest to make gay marriage legal via a legislative vote. Iowa legalized same-sex marriage in 2009 through a court ruling. Under the legislation, gay couples will be able to get married starting on Aug. 1.
    
Last week, Dayton, a Democrat, called the bill "one of those society-changing breakthrough moments." His staff scheduled a signing ceremony for 5 p.m. Tuesday on the Capitol steps.
    
It's a rapid turnaround for gay marriage supporters, who just six months ago had to organize a massive effort to defeat a constitutional amendment that would have banned gay marriage. The groups who defeated the amendment quickly turned their attention to legalizing gay marriage, and their efforts were aided by Democrats capturing full control of state government in November.
    
Only one Republican, Branden Petersen of suburban Andover, voted 'yes' on Monday. Three Democrats, all from rural Minnesota, voted against the bill.
    
In the last week and a half, Rhode Island and Delaware became the 10th and 11th states to legalize gay marriage. In Illinois, a gay marriage bill has cleared the state Senate but awaits a House vote.
    
The House vote last Thursday drew more than a thousand demonstrators representing both sides of the issue. But on Monday, the Capitol and grounds were dominated by gay marriage backers.
    
Supporters of gay marriage say they just want same-sex couples to have the same legal protections and societal validation that straight couples get with marriage.
    
Opponents say gay marriage undermines an important societal building block that benefits children, and also exposes people opposed on moral grounds to charges of bigotry.

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