Corporate America is letting its rainbow flag fly.

The number of companies earning a perfect score on the Human Rights Campaign’s 2018 Corporate Equality Index stands at a record 609, according to its annual report — up 18% from last year’s 517. The LGBTQ advocacy group ranked 947 companies on criteria related to nondiscrimination policies, benefits, public commitment to LGBTQ equality, competency and accountability around LGBTQ inclusion and diversity, and responsible citizenship.

The promising findings come as the federal government has rolled back some protections for LGBTQ Americans: The Justice Department said in July that federal civil rights protections didn’t cover discrimination on the basis of sexual orientation, and POTUS over the summer issued a ban via tweet on transgender soldiers serving in the military. It remains legal in 28 states, meanwhile, to fire a worker for being gay.

Also read: Five brave LGBTQ teachers tell Moneyish how they came out to their students

“One of the things that the Corporate Equality Index demonstrates is that business has not waited for a legal mandate to become LGBTQ-inclusive,” Beck Bailey, deputy director of the HRC Foundation’s Workplace Equality Program, told Moneyish in an interview. “They aren’t waiting for federal civil rights laws to change; they’re adopting their own inclusive policies and practices.” These companies, he said, are “doing it because it is certainly the right thing to do, but also it’s the good business decision in terms of creating workplaces that are attractive and welcoming of a diverse group of employees and inclusive of LGBTQ.”

Businesses have also increasingly spoken out “in the public square” against anti-LGBTQ legislation, he added: “Prior to that, we certainly have a history of companies speaking out for pro-equality initiatives … But really in the last few years we’ve seen companies also come out strong against anti-LGBTQ bills or anti-transgender bills like we saw in Texas, North Carolina and other places.”

Also read: 44% of LGBT people feel bullied at work — here are some of their stories

Nondiscrimination policies at 83% of Fortune 500 companies now include gender identity, according to the report, a stark increase from 3% just 15 years ago. Nine out of 10 Fortune 500 companies include sexual orientation in their nondiscrimination policies. And 97% of CEI participants explicitly protect against gender identity discrimination.

The report also found transgender employees making significant strides: Employers offering trans-inclusive health care coverage totaled 750, compared to 647 in 2016, and included nearly six in 10 Fortune 500 companies. A record 459 major employers now have inclusion guidelines for employees who are transitioning — compared to 90 in 2008.

Also readMeet Sam, a transgender nesting doll who teaches kids about gender identity 

“We see the Trump administration rolling back some protections and some equality measures for transgender people,” Bailey said, “and we see companies pushing forward on those initiatives to create more equality and equity for transgender people at work.”

Among the hundreds of companies earning top marks were Amazon, Apple, Facebook, General Motors, Google, McDonald’s Corp., Monsanto, Pfizer, Tesla and Verizon.