A bill which seeks to prohibit discrimination in the areas of employment, housing, credit and public accommodations on the basis of gender identity or expression cleared the Maryland Senate on Tuesday morning.

The measure, known as SB 212, cleared the state's upper chamber with a mostly party-line vote of 32-15.

A similar measure died in the Senate after passage in the House in 2011.

This year's effort was boosted by an amendment aimed at derailing the argument that such a law would allow men claiming to be women access to womens' restrooms. The amendment, approved unanimously, defines gender identity as being “sincerely held as part of the person's core identity.”

Dana Beyer, executive director of Gender Rights Maryland, applauded the vote in a statement.

“After eight years of struggle, and with the active support of Senate President Thomas V. Mike Miller, Jr. and the legislative magic of Senators Jamie Raskin, a comprehensive gender identity anti-discrimination bill has passed the Senate,” Beyer said, adding that supporters are “rightfully feeling elated this day.”

The bill now heads to the House of Delegates. Democratic Governor Martin O'Malley, who signed the state's marriage equality bill into law, has pledged his signature.