A trade group representing Google, Facebook, Amazon and other major internet companies said on Friday that they will back legislation aimed at stopping online sex trafficking, after initially opposing the bill despite its bipartisan support.

The Internet Association’s Michael Beckerman said that changes made to the legislation “will grant victims the ability to secure the justice they deserve, allow internet platforms to continue their work combating human trafficking, and protect good actors in the ecosystem.”

Internet firms feared that the initial language in the bill, the Stop Enabling Sex Traffickers Act, or SESTA, was too sweeping in its changes to a key provision of the Communications Decency Act that generally shields them from liability for content that users post on their site.

But they were put in the politically untenable position of opposing legislation that was garnering significant bipartisan support, a rarity in an otherwise fractured Congress. The law eliminates federal liability protections for websites that “knowingly assist, support, or facilitate” online sex trafficking. It also allows state and local prosecutors to go after websites that violate federal sex trafficking laws.

The most recent changes to the legislation include provisions to make it clearer that it is aimed at websites that are “knowingly” facilitating sex trafficking. Another change allows state attorneys general to bring federal civil actions against those who violate federal human trafficking law.

The legislation had drawn the support of some major media companies including 21st Century Fox and The Walt Disney Co. Major studios have long been at odds with Google and other internet sites over when they have the obligation to remove pirated content.

The legislation has been cited as an example of how tech firms are being put on the defense in Washington. This week, representatives from Google, Facebook and Twitter faced criticism from lawmakers over their response to the use of their platforms by Russian-linked firms to try to influence the 2016 election.

The legislation’s key co-sponsors include Sen. Rob Portman (R-Ohio) and Sen. Richard Blumenthal (D-Conn.).

“I’m pleased we’ve reached an agreement to further clarify the intent of the bill and advance this important legislation,” Portman said.