The Senate on Wednesday voted 50 to 49 to overturn a Trump administration policy that allows politically active nonprofits to withhold from the government the identities of their donors, underscoring a growing unease among Democrats over the influence of wealthy donors and foreign actors in U.S. elections.

The Senate move is unlikely to survive the GOP-led House, which must vote on the resolution before the end of the year, or receive the support of President Trump, whose Treasury Department enacted the rule earlier this year.

Still, Sens. Jon Tester (D-Mont.) and Ron Wyden (D-Ore.), who pushed for the resolution, cheered the vote, which was made possible with unanimous support from Democratic senators and the backing of one moderate Republican senator, Susan Collins of Maine.

The legislation only required a simple majority to pass under the Congressional Review Act.

“These dark money forces are a threat to our democracy, and they must be reined in,” Tester said in a statement. “Today’s action sheds more light on the wealthy few who are trying to buy our elections and drown out the voices of regular folks. We must wrestle our country back and continue to bring transparency and accountability back to political campaigns.”

Opponents of campaign finance restrictions criticized the resolution, saying donors should be able to participate in politics without fear of reprisal.

“No one should be the subject of intimidation or retaliation based on their personal beliefs,” said Brent Gardner, chief government affairs officer for Americans for Prosperity, the political arm of the network of groups supported by billionaire industrialist Charles Koch and like-minded donors.

The resolution is a “blatant attempt to stifle free speech and serves no purpose in the enforcement of tax regulations,” said Nathan Nascimento, executive vice president of Freedom Partners Chamber of Commerce, another Koch-backed group.

The legislation affects the information politically active nonprofits are required to provide to the Internal Revenue Service in their tax filings, not what they must disclose publicly.

Such groups are permitted to raise and spend unlimited amounts of money to try to influence elections as long as politics is not their primary focus.

Previously, these nonprofits would report their donors’ names, addresses and donation amounts to the public, and the IRS would then redact the names and addresses for public release.

In July, the Treasury Department released a new rule that no longer required nonprofits to share their donors’ names or addresses in their tax filings to the IRS. The groups were still required to retain the donor information and provide it to the IRS if the agency requests it.

Democrats and advocates for more restrictions on campaign finance had criticized the move, arguing it would make it easier for foreign actors to funnel money into the political system — a hot-button issue at a time when intelligence agencies are warning of foreign efforts to interfere in U.S. elections.

On the Senate floor, Tester criticized “our broken campaign finance system” and called on his colleagues to support the resolution to increase transparency: “When you don’t know who’s contributing the money, how do we know it’s not the Russians, that it’s not the Saudis, or other nations that are infiltrating our elections?”

Wyden, the ranking Democrat on the Senate Finance Committee, said in a statement that Wednesday’s vote was a “huge first step in America’s fight against anonymous political insiders looking to tighten their grip on Washington.”

A Senate Democratic aide, speaking on the condition of anonymity to speak freely about negotiations, said Democrats had sought out Collins to persuade her to vote yes by “making the argument that this is an IRS enforcement issue. The Tester-Wyden resolution is all about giving back to the IRS a tool that allows them to take action on suspicious activity.”

“Senator Collins believes that any organization that engages in political advertising should be required to disclose its donors,” said Annie Clark, Collins’s spokeswoman. “She has long supported efforts to fairly increase disclosure requirements for campaign activity.”

Some free-speech advocates have long expressed concerns that the names and addresses may be used by the government to politically target the donors, noting previous scandals that found the IRS targeted tea party and progressive groups.

They also note the risk of donor information being released by accident, either by the IRS or by the nonprofits.

As a presidential candidate, Trump repeatedly criticized the role of big money in politics, particularly undisclosed donations.

“I want transparency,” he told Time magazine in August 2015. “I don’t mind the money coming in. Let it be transparent. Let them talk, but let there be total transparency.”

The Treasury Department and the White House did not immediately respond to requests for comment.

Jeff Stein contributed to this report.