The Maryland House of Delegates on Thursday approved a bill banning discrimination on the basis of gender identity, positioning the Old Line State on track to join 17 others and the District of Columbia in protecting the rights of transgender individuals.

Senate Bill 212, otherwise known as the Fairness for All Marylanders Act of 2014, made it through the Democratic-controlled House by a vote of 82-57, after more than two hours of floor debate. It passed the state Senate earlier this month, 32-15, and now heads to the desk of Democratic Gov. Martin O’Malley for signature.

“I’m thrilled that we’ve been able to accomplish this,” Democratic state Sen. Rich Madaleno, the bill’s sponsor and the only openly gay member to have ever served in the state Senate, told msnbc. “It took a lot of effort, many years of outreach and education, but it’s remarkable how much progress we’ve been able to make in Maryland, especially over the last four years.”

Madaleno also led the fight for marriage equality in the state, which has been legal since Jan. 1, 2013. The senator got his “paperwork marriage” last August, but has considered himself a married man since 2001.

Once enacted, SB 212 will protect transgender Marylanders from labor, housing, public accommodation, and employment discrimination. Though Baltimore City, Baltimore County, Howard County, and Montgomery County already provided such protections, the 2001 statewide anti-discrimination law only included protections based on sexual orientation.

“What we are about to do today is important,” said Democratic Del. Maggie McIntosh, as reported by the Washington Blade. “This is an important group of people today who frankly we left out 11 years ago. They’re beat up. They’re ridiculed. They are suffering and they need to hold their head up high just like I do.”

Recent polls found wide support for the bill’s protections, as well as necessity. According to a 2009 survey from the National Center for Transgender Equality and the National Gay and Lesbian Task Force, 54% of transgender Marylanders reported being harassed in places of public accommodation, such as restaurants, stores, and movie theaters. Seventy-one percent of those surveyed in a March Goucher Poll said they favored including gender identity protections in the state’s anti-discrimination laws.

But detractors expressed concerns that the measure could potentially be abused by sexual predators seeking to prey on women and children in public restrooms. Some even dubbed it the “bathroom bill.”

“We need to know whose safety comes first,” said House Minority Whip Kathy Szeliga, who offered, then withdrew, an amendment Wednesday to remove public accommodations from the bill. “We should be very concerned about the safety of women and little girls, because what this allows without striking accommodations are possible predators and pedophiles from going in our women’s restrooms.”

In an email blast obtained by Metro Weekly, Republican Del. Kathy Afzali even went so far as to mockingly warn female constituents to be on the lookout for “a guy in a dress” at restaurant bathrooms.

“I want to take this opportunity to let you know that I am completely and unequivocally opposed to this bill, which doesn’t aim to end discrimination, but to normalize abnormal behavior,” Afzali wrote of HB 1265, a House version similar to the Fairness for All Marylanders Act. “It is important that Maryland does not separate one’s ‘gender identity’ and their ‘assigned sex at birth’ as noted in the bill. Like the majority of Marylanders, I share the view that this redefinition rejects our society’s understanding of human nature.”

“So, ladies,” she joked, “if you happen to see a guy in a dress in the restaurant bathroom, you’ll know the bill passed and I voted NO!”

Szeliga put forth a narrower amendment on Thursday that would have exempted bathrooms from the measure. Republican Del. Anthony O’Donnell also introduced a proposal to ban people from using their gender identities as an excuse “to enter a place of public accommodation for the purpose of committing an illegal activity.” Both were defeated.

“Over the last 14 years in Maryland, we’ve been able to pass every major piece of gay rights legislation, and I think the other side was realizing this was the end,” said Madaleno. “They tried to throw everything but the kitchen sink to try and derail this effort. But they lost, and they lost by a larger margin than they lost on marriage equality.”

Supporters insisted that removing public accommodation protections would have gutted the bill because they apply to more than just restrooms. Additionally, they noted, there has been no evidence to suggest that such protections would lead to increased attacks in women’s bathrooms. According to Media Matters, who spoke with law enforcement and victims advocacy groups in 12 of the 17 states that bar anti-transgender discrimination, there have been no reported incidents of sexual assault arising from these laws.

“The argument that providing transgender rights will result in an increase of sexual violence against women or men in public bathrooms is beyond specious,” said Toni Troop, spokesperson for a Massachusetts sexual assault victims organization, to Media Matters. “The only people at risk are the transgender men and women whose rights to self-determination, dignity and freedom of violence are too often denied.”

Thursday’s vote marks a major victory for LGBT advocates, who have been trying to pass transgender protections since 2001. But just because Maryland now has both marriage equality, and full LGBT anti-discrimination laws doesn’t mean they’re ready to pack it in.

“There’s still work to be done on issues for youth and the aging population, much more racial justice work for black, LGBT members, [and] immigrant justice issues,” explained Carrie Evans, executive director of Equality Maryland, to msnbc. “For so many years, the focus has been marriage equality and transgender equality. Not that’s behind us. But there are a lot of people in our community who still have needs.”