ANNAPOLIS — The Senate voted Thursday to legalize same-sex marriage, making Maryland the eighth state along with the District to approve such legislation.
The chamber voted 25-22 in favor of the measure, which passed the House last week. The bill will now go to Gov. Martin O’Malley, a Democrat who sponsored the legislation and said he will sign it into law next week.
After narrowly passing the sharply-divided House with some last-minute vote wrangling by Democratic leaders, the bill had a much easier road in the Senate.
“It’s just a remarkable day for the people of the state of Maryland,” said Sen. Richard S. Madaleno Jr., a Montgomery Democrat who is openly gay. “And I’m just so proud that I’ve been a part of it.”
Supporters had lobbied since last year’s bill died in the House and received a valuable ally last summer when Mr. O’Malley announced he would sponsor this year’s bill, hoping to follow in the footsteps of New York Gov. Andrew M. Cuomo, a Democrat who last year successfully shepherded a gay-marriage bill through his legislature.
This year, supporters continued to argue that marriage is a civil right that should also apply to gays, but also based a larger part of their argument on assuring religious groups that the bill would not infringe on their beliefs.
The bill would allow gays to enter state-recognized marriages but would exempt religious institutions and faith-based groups from having to perform or recognize such unions.
After the House passed this year’s bill by a 72-67 vote, the Senate engaged Thursday in a pair of largely civil debate.
Opponents submitted several amendments — including changes to increase protections for religious groups and religion-minded residents — all of which were rejected by the bill’s supporters.
The House passed amendments last week to push the bill’s effective date from October to January and prevent it from being enacted until any lawsuits over a referendum effort are resolved.
The amendments would also require the law to be voided if any part is declared unconstitutional.
The Senate resisted further amendments largely in an effort to keep the bill from returning to the contentious House, to the dismay of opponents.
“If we have opportunity to improve upon this bill, then we should do so,” said Sen. Christopher B. Shank, Washington Republican. “And I think it is our obligation to do so.”
The legislation passed with support from 24 of 35 Democrats and just one of 12 Republicans — Sen. Allan H. Kittleman, Howard Republican. It was opposed by Senate President Thomas V. Mike Miller Jr., who said he still considers marriage between a man and woman.
“Am I on the wrong side of history, as a historian? There’s no doubt,” said Mr. Miller, a Prince George’s Democrat. “But at the same time, I understand that I’ll deal with that in my own mind.”
The Senate’s passage now gives opponents the official go-ahead to begin a petition effort to force a referendum.
Petitioners would have until June 30 to collect 55,736 valid signatures from registered voters. If successful, the law would be suspended and put on this November’s ballot.
Lawmakers on both sides of the issue have acknowledged that gay marriage will likely go to referendum, especially in the wake of last year’s successful petition effort against the state’s so-called Dream Act.
Opponents gathered 108,000 valid signatures against the law, which would have allowed many college-aged illegal immigrants to pay in-state tuition rates.
Delegate Neil C. Parrott, Washington Republican, helped lead the effort, which owed much of its success to the use of mdpetitions.com — a website that allowed residents to download and circulate their own copies of the petition.
Mr. Parrott said gay-marriage opponents will likely use the same website this year. He said organizers must first get language in the petition approved by the state Board of Elections and attorney general, but that they hope to begin collecting signatures in as few as two weeks.
Many gay-marriage supporters have bristled at the thought of a referendum, arguing that the bill is a civil rights measure and should thus not be left in the hands of a potentially unwilling public.
Mr. O’Malley said he understands such concerns but has faith that voters will make the right decision. Recent polls show Marylanders to be divided almost evenly on the issue.
“I have a great amount of trust, faith and intelligence of the people of Maryland,” the governor said. “So I don’t fear their judgment.”