The debate over altering a bedrock law governing the internet in the name of curbing sex trafficking was polarizing. The final vote was not.

The Senate Wednesday voted 97-to-2 to approve changes to the law that has shielded website operators from liability for content posted by others. The Stop Enabling Online Sex Trafficking Act was previously approved by the House and now goes to President Trump, who endorsed it earlier this month.

The legislative effort inspired fervent opposition along the way from Google, free-speech stalwarts, and sex workers. Supporters of the bill say it will allow victims of online sex trafficking to legally pursue websites that facilitate trafficking, Until now, those efforts have been thwarted by the liability shield in Section 230 of the Communications Decency Act. The bill was proposed after a California judge dismissed criminal charges against Backpage.com and its CEO over online ads featuring underage girls because of Section 230.

Opponents fear that the bill messes with a key ground rule that has allowed the internet to flourish. “Section 230 we’ve been saying for a long time is responsible for creating the modern internet that we know and love—not to say that the current Internet doesn’t have problems,” says India McKinney of the Electronic Frontier Foundation. But, she says, the law provided the “the legal buffer that was needed to create these online communications platforms.”

Approval of the bill highlights tech’s diminishing clout in Washington, following revelations about Russian meddling in the 2016 election and concerns about respect for users’ privacy. Google lobbied heavily against early versions of the bill, but muted its criticism in recent weeks as the bill gathered momentum following testimony by victims’ families.

Tech companies need to be held accountable for “breaches of trust and moral obligation,” cosponsor Senator Richard Blumenthal (D-Connecticut) said in a press conference held as the votes were still coming in. “We’re not going to simply abide by the reassurance, ‘Trust us. We’ll do the right thing.’ … There’s a growing feeling that there’s need for stronger rules of the road when it comes to accountability in this industry.”

Google, which has funded nonprofits that both supported and opposed the bill, declined to comment. In a blog post from September about an earlier version of the bill, Susan Molinari, vice president of public policy, emphasized Google’s investment in efforts to curb sex trafficking, but argued that the bill could cause smaller companies to stop moderating sex trafficking. “This would be a disaster,” she wrote.

The Internet Association, a trade group representing many tech companies including Google, said in a statement following the Senate vote that the industry “shares the goals of lawmakers who want to put an end to trafficking online," but focused on the urgency of keeping tech's liability shield intact. “IA will continue our work to preserve Section 230 and prevent attempts to weaken this crucial protection protection,” the group said.

On its way to final passage, the bill was altered several times, including an amendment in December that created a new prostitution crime and then a last minute amendment in February that restored the ability of state law enforcement and private plaintiffs to go after companies like Backpage.

The new crime, intent to facilitate prostitution, was introduced under the Mann Act, the infamous 1910 law known as the White Slavery Act, which critics argue has been enforced in a discriminatory way. Roping in the Mann Act alarmed activists for sex workers, whose voices have dominated coverage of the bill in recent weeks.