A former math teacher. A firefighter. A lawyer. A small-business woman. A full-time doctoral student. A congressional aide.

When the legislative session started in January, the six delegates from different cliques in Maryland's clubby General Assembly had this in common: None would have called himself or herself a supporter of Gov. Martin O'Malley's bill to legalize same-sex marriage.

Yet all cast votes Friday in favor of the measure, providing the margin needed to pass the bill, 72-67, in the House of Delegates, which had rejected a similar measure 11 months ago.

Some never let on that they were wavering. Those who did faced the same formidable political and social forces that managed to scuttle the measure last year, including a strong and organized lobby from some of the state's most influential church leaders. One lawmaker, a Catholic, received a phone call from Rome from Cardinal-designate Edwin F. O'Brien, who was elevated to that rank Saturday. All confronted the threat of being unseated by opponents of gay marriage when the delegates face re-election campaigns in 2014.

But this time the faith-driven opposition didn't carry the day. Instead, lawmakers say, they were swayed by the emotional stories of gay couples. Some delegates wanted to be assured that churches would never be forced by the state to preform same-sex marriages. Several were convinced that voters would get the final say. Their decisions pushed the vote count past the 71 needed to pass the measure.

Like many legislators, Dels. A. Wade Kach, Robert A. Costa, Tiffany T. Alston, Pamela G. Beidle, John A. Olszewski Jr. and John L. Bohanan Jr. struggled with the decision. They were among the last to declare support for the bill; three flipped their votes last week.

Jubilant supporters are looking to the next step — a vote in the Maryland Senate, which approved a similar measure last year and is likely to do so again. If the bill passes, it is expected to be petitioned to referendum and go before the voters in November. Opinion polls show they are evenly split on the issue.

Seven states — Connecticut, Iowa, Massachusetts, New Hampshire, Vermont, New York and Washington — along with the District of Columbia, have approved gay nuptials. Same-sex marriage measures could be on the November ballot in Maine and Washington state.

Hours before Maryland's House approved the bill, a same-sex marriage bill was vetoed in New Jersey by Republican Gov. Chris Christie, an O'Malley rival.

But Friday, the national spotlight was focused on Maryland's 141-member House, where O'Malley aides said they were not sure they had the votes until the final count was read aloud. For nearly a year, a tight group of supporters had fanned out to talk with any and every delegate they thought they could move.

"It was a grind until the end," said Joseph Bryce, O'Malley's top legislative aide, who in July was tasked with pulling the votes together. In the final weeks, he had said they were within "striking distance," but they went into the day of the vote with no margin for error.

Even as the measure went to a final House vote, he was not sure. Delegates were lobbying on the floor until the final moments.

The state's black churches played a key role in the opposition. And as votes slipped away last week, they suggested that the defections were more about politics than conscience.

"There is no question there were unscrupulous practices," said the Rev. Derek McCoy, executive director of the Maryland Marriage Alliance. "Oh, absolutely. Deals were being cut for certain amendments and certain concessions."

Lawmakers interviewed for this article denied that they were given anything for their votes. They said they took time to think about personal stories from gay and lesbian couples they met during hearings or in private meetings. Others wanted changes to the bill and worked with O'Malley's aides to find the right balance.

One — Alston — still opposes same-sex marriages and pledged to help organize a referendum against the measure. But she said she wants the state to move past the issue.

Another, Bohanan, did not change his view until the evening before the vote.

In the end, they seemed relieved.

"I'm glad this is over," said Kach, as he walked out of the State House. One of two Republican lawmakers to change his vote from last year, no one came under more pressure. When the Baltimore County delegate announced his position Thursday, he received threats. State troopers followed him around the State House for the day.