HILADELPHIA (Reuters) - The Maryland State Senate passed legislation on Thursday night to allow same-sex marriage.

The Civil Marriage Protection Act, approved by the heavily Democratic Senate on a 25-21 vote with strong support from the majority party, would effectively legalize gay marriage without forcing religious clergy to conduct marriages of which they disapproved. It had narrowly passed two preliminary stages of approval.

Senator Richard S. Madaleno Jr., a Montgomery County Democrat and the senate's first openly gay member, hailed the vote as historic.

"It demonstrates our commitment to civil rights and equality to all," he said in an email to supporters. "The House of Delegates should act swiftly to provide loving families across our state with the dignity and respect we deserve."

He said the bill is the same as a similar act in Washington, D.C., in that it exempts religious leaders from performing ceremonies if they object to same-gender marriage.

The next step is up to the Maryland House, expected to begin a hearing on the bill on Friday.

One House member, Heather Mizeur, another Montgomery County Democrat, believes her party is probably a couple of votes short of having 71 absolute commitments for the bill.

The Democrats hold a 98-43 majority in the House, but Mizeur says some party members are reluctant to vote for the bill because of religious beliefs, or because they are concerned about narrow margins of victory in the last election.

Still, Mizeur, also openly gay, said: "I have every confidence that when the votes are counted we will win."

Opponents of the bill could not be reached immediately for comment.

Maryland would become the sixth state to allow gay and lesbian couples to marry if the legislation is approved and signed into law.

The senate vote came a day after President Obama told the Department of Justice to stop defending the Defense of Marriage Act opposing same-sex marriage because he believes it is unconstitutional.

(Additional reporting by Wendell Marsh; Editing by Jerry Norton)