WASHINGTON — The Senate on Wednesday narrowly advanced a Democratic-led attempt to retain net neutrality regulations, the first step in a long-shot bid to keep the online traffic rules on the federal books before their repeal takes effect in June.

The effort, which has built momentum in recent weeks, also is intended to elevate net neutrality as a political issue in the fall elections.

Supporters portrayed themselves as defenders of the rights of Americans to unfettered access to the internet by keeping protections in place that they said would prevent telecommunications companies from serving as gatekeepers for online content.

“This issue presents a stark contrast: Are you on the side of the large internet and cable companies, or are you on the side of the average American family,” said Senate Democratic Leader Charles E. Schumer, D-N.Y.

“This is our chance, our best chance, to make sure the internet stays accessible and affordable for all Americans,” he said as the debate began.

But most Republicans opposed the effort, saying the regulations were potentially too onerous and Democrats were trying to use the issue for partisan gains in November.

Sen. John Thune, R-S.D., called it a “highly politicized campaign” that was filled with “fear-mongering hypotheticals, misdirection and outright false claims.”

The measure, approved by a 52-47 vote, would void a decision made in December by the Republican majority of the Federal Communications Commission to scrap the regulations established in 2015 by the agency when Democrats controlled it during the Obama administration.

The repeal takes effect June 11.

All 47 Democrats voted to keep the rules in place. They were joined by the two independents who usually vote with them, Sens. Angus King of Maine and Bernie Sanders of Vermont, as well as three Republicans — Susan Collins of Maine, John Kennedy of Louisiana and Lisa Murkowski of Alaska.

Collins announced her support in January, but Kennedy and Murkowski had been undecided. They were the focus of heavy lobbying by net neutrality supporters in recent days in hopes of having a stronger bipartisan vote.

Neither tipped a hand until they voted a few hours earlier Wednesday to move the measure past a procedural hurdle. Murkowski spent about 30 minutes on the Senate floor discussing that procedural vote with key Republicans and Democrats before making her decision.

Net neutrality supporters are using a legislative tactic, the Congressional Review Act, that allows lawmakers to block an action taken by a federal agency with a simple majority vote in the House and Senate and the president’s approval. The measure cannot be filibustered in the Senate.

But the effort faces an uphill battle in the House, where Republicans have a larger majority, and at the White House, where President Donald Trump would be expected to veto the measure.

The net neutrality rules prohibit internet service providers from selling faster delivery of certain data, slowing speeds for specific content and blocking or otherwise discriminating against any legal material.

The regulations are strongly supported by liberals and online companies including Amazon, Netflix, Facebook and Google and dozens of smaller web-based companies.

Republicans said the regulations threaten heavy-handed government intrusion that would stifle innovation on the internet. Telecommunications companies oppose the regulations.

Polls also have showed strong public backing for net neutrality. Democrats think the fight to restore the rules could be a political winner during November’s congressional midterm elections even if the effort is unsuccessful because it will force Republicans to vote against reinstating the rules.

That was evident Wednesday as Democrats paraded to the Senate floor to give speeches in support of net neutrality while most Republicans were silent on the matter.

“We will take a stand to protect our online economy, or we will say goodbye to the internet as we know it,” said Sen. Ed Markey, D-Mass., the leader of the Senate effort.

He and other supporters of the rules argue that they will prevent AT&T Inc., Comcast Corp. and other internet service providers from acting as gatekeepers for Americans’ online access.

Senate Majority Leader Mitch McConnell, R-Ky., said Wednesday that the solution was for lawmakers to draft net neutrality legislation “that would safeguard consumers but still prevent regulators from stifling innovation.”

“But Democrats have already made clear that the resolution today is about the elections in November,” McConnell said before the debate began. “They know they won’t ultimately be successful, but they want to campaign on their desire to add new regulations to the internet. This resolution takes us in the wrong direction, and we should reject it.”

A major objection about the rules was the FCC’s decision to classify broadband as a more highly regulated utility-like service under Title 2 of federal telecommunications law.

Although the FCC exempted internet service providers from many aspects of that tougher oversight, such as rate regulation, opponents of the 2015 net neutrality rules said it opened the door to onerous federal regulation.

“Such an approach would curb the necessary investment and infrastructure improvements that are critical for connecting more Americans to high-speed broadband and enabling wider internet access, especially in poor and rural areas,” the leaders of three leading internet service provider trade groups — the NCTA, CTIA and USTelecom — wrote to Senate leaders on Tuesday.

Thune has been pushing for bipartisan legislation, a draft of which he proposed in 2015, that would give the FCC limited authority to enforce net neutrality protections.

“Why aren’t we debating a bipartisan bill instead of a partisan resolution?” he asked. “Well, some on the other side of the aisle reached the cynical conclusion that exploiting concern about the internet outweighed the value of working with Republicans to pass net neutrality protections.”

Supporters of net neutrality regulations said they hoped the stronger-than-expected Senate vote would provide momentum as the fight to retain the existing regulations moves to the House.

A House companion to the Senate measure, by Rep. Mike Doyle, D-Pa., has 161 co-sponsors, all Democrats. Even if it got the support of all 193 House Democrats, it would need more than two dozen Republicans to force a vote over the objections of the chamber’s GOP leaders.

(EDITORS: STORY CAN END HERE)

Net neutrality supporters note that 15 Republicans crossed the aisle in March 2017 on another internet issue. They voted to uphold FCC broadband privacy regulations that Republicans repealed using the Congressional Review Act. But net neutrality regulations are much more widely opposed by Republicans.

Rep. Tom McClintock, R-Calif., was among the Republicans who voted with Democrats on the privacy regulations. But in 2015, the day after the FCC enacted the net neutrality rules, McClintock went to the House floor and blasted the agency as “imposing leftist ideology on the internet.”