Sen. Adam Ebbin, D-Alexandria, recalled his first visit to the General Assembly about 30 years ago to lobby for gay rights.

“Very few lawmakers came out of their offices to meet with us, and I don’t think it made a difference — at least at that time,” he said. “Now we have five members of the LGBT caucus, which would have been unthinkable a few years ago.”

Ebbin, the first openly gay person elected to state office in Virginia, relayed the story Thursday as a marker of just how much the state has changed as the legislature passed the Virginia Values Act, which extends sweeping anti-discrimination protections to LGBTQ people.

The legislation not only adds sexual orientation and gender identity as protected classes in housing, employment and public accommodations, it establishes a new framework for people who feel they’ve been discriminated against to take legal action against the offending party. Those causes of action would also apply to discrimination based on race, age, sex, religion, pregnancy, veteran status and other categories.

The bill also enables the attorney general’s office to pursue civil action against anyone “engaged in a pattern or practice of resistance ” to the civil rights spelled out in the proposed law.

National human rights groups heralded Thursday’s vote as a historic breakthrough that makes Virginia the first state in the South to enact such protections.

“You’re not free if you’re discriminated against in housing and employment, and this legislation is going to change that so LGBT people can be free like everyone else,” said Human Rights Campaign Alphonso David.

The legislation passed the state Senate on a bipartisan, 30-9 vote. The House of Delegates approved the bill by a vote of 59-35, with three Republicans joining with the chamber’s 56 Democrats.

The legislation still needs to flip chambers and pass again before being sent to Gov. Ralph Northam’s desk, but it’s not expected to face major hurdles.

Some Republicans have called the bill overbroad, saying it could infringe on religious freedom. On the House floor Thursday, Del. Dave LaRock, R-Loudoun, warned it could force business owners to accommodate same-sex weddings and require the use of certain pronouns for transgender people.

“There are many people in this commonwealth who would say that their religious convictions are part of who they are,” LaRock said.

Democrats noted the bill includes exemptions for religious entities and private clubs.

“If you open your business to the public, that means everyone in the public,” said Del. Mark Sickles, the bill’s sponsor. “This is a bill about civil society. It’s about what we do in the civil world. It’s not about what you do in your private religious life.”