State Sen. Richard Madaleno

State Sen. Richard Madaleno, who is gay, cheers after the Senate approved a bill that would legalize same-sex marriage. (Algerina Perna / The Baltimore Sun / February 23, 2012)

Gov. Martin O'Malley's bill to legalize same-sex marriage quickly won approval in the Maryland Senate Thursday night. The measure now needs the governor's signature.

Cheers erupted in the Senate chambers after the 25-22 vote was read out loud and the group of seven gay and lesbian lawmakers from the House of Delegates rushed to the middle of the floor to embrace supportive senators.

"I think I'm speechless," said Sen. Richard Madaleno, the only openly gay senator. "This is a remarkable day."

O'Malley, a Democrat, shook hands with activists after the vote. "This has been a difficult issue for many people," he said. "But as one Maryland we came together around the principal of human dignity. … It does feel good to have this issue resolved."

The vote makes Maryland the eighth state to approve gay nuptials — and the fourth state legislature to do so in the past 12 months.

Underscoring how the debate has put Maryland in the national spotlight, reaction came swiftly from U.S. House Democratic Leader Nancy Pelosi, who called it "an extraordinary victory," and several D.C.-based gay rights groups.

The approval in Annapolis caps years of failed attempts by gay-rights advocates to gain equal access to marriage and the legal protections that accompany the union. The governor said he plans to sign the legislation next week.

Implementation of the measure is far from certain. Even supporters concede that the law will likely be petitioned to referendum, and they expect Maryland voters to have the final say in November. The legislation has an effective date of January 2013 — well after the November election.

"We move on to the next phase," said Senate Republican leader E.J. Pipkin, who tried to defeat the bill. "There will be a robust referendum effort." Recent polls have shown that Marylanders are evenly split on the issue, so it is difficult to predict what will happen at the ballot box.

Still, supporters rejoiced. Among those who came to witness the vote from the Senate galleries — and applaud its outcome — were Katie Fitzsimmons and Coley Haywood of Annapolis, a gay couple who would like to marry.

Fitzsimmons, 32, said she was overjoyed. "I can't explain the emotion. I was smiling and then I was crying," she said.

The pair, who have been a couple for four years, said they have waited to get married until they could do so in Maryland. If the law survives the expected referendum, "we'll get married right away," Fitzsimmons said. "It's a game-changer. This changes our lives forever," she said.

"We can be equal with everyone else," said Haywood, 31. "Our friends and family can't wait."

Just three years ago, the same-sex marriage effort in Maryland seemed stalled because a key Senate committee lacked the votes needed to move a bill to the floor. That changed after the 2010 election, when the chamber picked up two more Democrats and Senate President Thomas V. Mike Miller reconfigured the membership of all committees.

Miller never supported the bill, but he allowed it to come to the floor and worked to ensure that a filibuster could be cut off if needed. He took the unusual step of explaining his red vote from the rostrum.

"I don't think this is civil rights, but this is history," he said.

"Am I on the wrong side of history?" Miller asked. "As a historian, there is no doubt about it. But I understand that and I'll deal with that in my own mind. I believe marriage is between a husband and a wife, and that is why I voted the way I did," Miller said.

Opponents were initially caught off guard last year when a same-sex marriage bill cleared the Senate, but activists — primarily from black churches and the Maryland Catholic Conference — put their forces together. The bill stalled in the House of Delegates; it was pulled from the floor when supporters realized they did not have the votes for passage.

This year, the governor put his name, and the full force of his office, behind the bill. He worked closely with a progressive coalition and House Democratic leaders to find the votes needed.