ST. PAUL, Minn. - The Minnesota Senate has voted to legalize gay marriage, putting the state on the brink of becoming the 12th to allow same-sex couples to marry.

Gov. Mark Dayton says he will sign a bill legalizing gay marriage in a ceremony on the Capitol steps on Tuesday.

The state Senate voted 37-30 to pass the bill. The bill passed the House last week. It allows same-sex weddings beginning Aug. 1.

With Dayton's signature, Minnesota would be the first Midwestern state where elected representatives voted directly to allow gay marriage. Iowa has had gay marriage since 2009, but that was due to a court ruling.

Just six months ago, Minnesota voters rejected an effort to ban gay marriage in the state constitution.

The bill's sponsor, Sen. Scott Dibble of Minneapolis, choked up spoke moments before the vote said that he was proud to Minnesotan on this day.

The governor's staff said Dayton will sign the bill at 5 p.m. with legislators and supporters on hand.

Three Democrats and one Republican senator are crossover votes.

Democratic Sens. Dan Sparks of Austin, LeRoy Stumpf of Plummer and Lyle Koenen of Clara City voted Monday against allowing same-sex couples to marry. On the flip side, GOP Sen. Branden Petersen of Andover joined the rest of the Democratic majority in passing the bill.

Petersen says he was hopeful that more Republicans would have broken ranks, and some told reporters that they were undecided up until the vote.

Sparks and Koenen say they were reflecting the will of their district. Those senators represent areas that supported a constitutional ban on gay marriage last fall. Sparks says it was "by far" his toughest vote ever.

St. Paul city officials announced an outdoor concert right after the signing at a downtown plaza with more than a half-dozen performers. They're calling it the "Love is Law" concert.