Congressional Republicans knew their plan was potentially explosive. They wanted to kill landmark privacy regulations that would soon ban Internet providers, such as Comcast and AT&T, from storing and selling customers’ browsing histories without their express consent.

So after weeks of closed-door debates on Capitol Hill over who would take up the issue first — the House or the Senate — Republican members settled on a secret strategy, according to Hill staff and lobbyists involved in the battle. While the nation was distracted by the House’s pending vote to repeal the Affordable Care Act, Senate Republicans would schedule a vote to wipe out the new privacy protections.

On March 23, the measure passed on a straight party-line vote, 50 to 48. Five days later, a majority of House Republicans voted in favor of it, sending it to the White House, where President Trump signed the bill in early April without ceremony or public comment.

“While everyone was focused on the latest headline crisis coming out of the White House, Congress was able to roll back privacy,” said former Federal Communications Commission chairman Tom Wheeler, who worked for nearly two years to pass the rules.

The process to eliminate them took only a matter of weeks. The blowback was immediate.

Constituents heckled several of the lawmakers at town halls. “You sold my privacy up the river!” one person yelled at Sen. Jeff Flake (R-Ariz.) — lead sponsor of the Senate bill — at a gathering in April. Several late-night comedians roasted congressional Republicans: “This is what’s wrong with Washington, D.C. I guarantee you there is not one person, not one voter of any political stripe anywhere in America, who asked for this,” Stephen Colbert said.

The quick undoing of the Internet privacy rules has prompted lawmakers in more than a dozen states to propose local laws to restore privacy protections to their constituents.

The FCC privacy rules were among the first of more than 100 regulations and laws being targeted for elimination or massive overhaul by Trump and Republican members of Congress who want to dismantle Obama-era regulations they view as burdensome.

How the privacy rules came to be undone helps to explain and inform the strategies behind the broader range of Republican initiatives in the works. The rollback of privacy, for example, was the first step by the Republican-led FCC to overhaul Obama-era net neutrality rules .

The rolling crises within Trump’s administration and Republican infighting have slowed Republican lawmakers’ work on Capitol Hill. But they remain positioned to capi­tal­ize on their control of the White House and both chambers of Congress, a power structure that has not existed in more than a decade.

“Trump and the Republicans are doing so many different things on parallel tracks, the news media and activists can’t follow it all,” said Trump adviser and former House speaker Newt Gingrich. “This is by design.”

How Trump is rolling back Obama’s legacy

The Internet privacy rules were adopted in October during the last days of the Obama administration after an intense battle that pitted large Internet service providers, the advertising industry and tech giants against consumer advocates and civil rights groups.

The rules required Internet service providers to get explicit consent before they gather their customers’ data — their browsing histories, the locations of businesses they physically visit and the mobile applications they use — and sell it to third parties. Proponents said the rules were necessary because consumers must use a provider to access the Internet.

The requirements were modeled after a law passed decades ago by Congress that prohibited telephone companies from collecting customers’ calling histories and selling the information to third parties. “There has been an expectation from the beginning of the telecommunications era that your privacy is not up for sale,” said Sen. Edward J. Markey (D-Mass.), who fought to preserve the rules.

READ THE DOCUMENTS: The rule and comments from commissioners and industry groups are here

The industry, Republican FCC commissioners and GOP lawmakers said the restrictions were too broad and should be limited to highly sensitive data, such as personal medical information, not data gathered from activities such as online car shopping. The rules, they said, would cause consumers to miss out on customized promotions. And, opponents said, the threat to privacy was overstated — a provider might learn that a person visited a website but would not typically know what the person did while there.

Because the commission’s privacy rules passed on a party-line vote, three Democrats in favor and two Republicans opposed, the rules were viewed as extremely partisan. This made them vulnerable from the start, said Jon Leibowitz, co-chair of the 21st Century Privacy Coalition, a group financed by Internet providers, which led the effort to eliminate the requirements.

The campaign to kill the FCC rules began just a few weeks after Trump’s victory in November.

Lobbyists from trade groups funded by large broadband companies — including Leibowitz’s group and the Consumer Technology Association — made phone calls and held small, private meetings with Republican congressional aides, according to Hill staff, consultants and lobbyists on both sides of the issue. They were shopping for bill sponsors and approached Flake and Rep. Marsha Blackburn (R-Tenn.), who had been vocal opponents of the rules when they were being crafted at the FCC. The two agreed to champion the cause.

“We had a broad coalition of groups, and we thought, ‘We don’t like it; let’s present this to them,’ ” said Julie Kearney, vice president of regulatory affairs with the Consumer Technology Association. “The administration and Congress did not come to us.”

Flake and Blackburn declined to comment for this article.

Kearney said trade groups for Internet service providers asked lawmakers to use a legislative maneuver under the Congressional Review Act that allows Congress to kill recently adopted regulations with a simple majority vote. Before the 2016 elections, the 21-year-old act had been used only once, in 2001. Since November, Congress and Trump have employed it 14 times to kill Obama-era initiatives.

“The last administration was very aggressive with regulations,” said Sen. Richard Burr (R-N.C.), who voted to eliminate the privacy rules. “We are looking for the quickest ways to do something about it.”

By January, trade groups for tech companies such as Facebook and Google had joined the fight to undo the privacy rules, according to records and interviews. Those companies are regulated by a different government body, the Federal Trade Commission, but they worried that Congress might someday find a way to expand the reach of the rules so that they apply to all technology companies.

Trade groups for large advertisers also got involved in the effort to repeal the law, as did the U.S. Chamber of Commerce.

Consumer and civil rights groups were quickly outnumbered by their opponents, by a ratio of at least 50 to 1, according to Hill staff and lobbyists.

“This collaboration between Silicon Valley and cable companies has never been done before,” said Gene Kimmelman, president and chief executive of Public Knowledge, a nonprofit group that advocates for an open Internet and affordable technology. “Their united, massive economic and political power was insurmountable.”

During the battle, Flake and Blackburn received large campaign donations from eight of the major Internet providers and big tech companies that wanted to see the rules killed, according to an analysis by the Center for Responsive Politics.

The groups gave Flake $22,700 in donations, compared with an average $4,510 they gave other senators between January and April. The groups gave Blackburn $20,500, compared with the $2,045 average donated to other House members in the same time. That is about three times the amount of money Flake and Blackburn received from those groups during the first quarter of last year.

Groups that worked to preserve the FCC rules donated no money to lawmakers during the first quarter of this year, according to the analysis.

By February, neither the House nor the Senate had introduced a bill. It appeared to some that the issue might have stalled — which caused several consumer and civil rights groups, such as the Color of Change, to let down their guard.

“We didn’t think they would have the audacity to go after privacy. . . . We dismissed the low rumblings,” said Brandi Collins, a senior campaign director at Color of Change, who said data-directed advertising often targets minorities.

By the end of February, the trade groups for large Internet providers, the advertising industry and tech companies were working in tandem with congressional members who had taken up their cause. Howard Waltzman, a lawyer and lobbyist for the 21st Century Privacy Coalition, said this was “the pivotal moment.”

An opinion piece under Flake's byline appeared in the Wall Street Journal on March 1, saying the rules took away "consumer choice" because people's browsing histories could not be used to offer them "innovative and cost-saving product offerings." The column said the rules would "create confusion" among customers because the FCC and FTC would regulate different parts of the "Internet ecosystem." The same arguments and similar phrasing were used in a letter the industry coalition sent to Congress.

Hours after Flake’s opinion piece appeared in the Journal, he introduced a Senate bill to kill the rules. A week later, Blackburn did the same in the House.

For weeks, neither Flake nor Blackburn scheduled a vote because members feared a potential backlash from voters, according to lobbyists and several Hill staff members.

“There was a bit of chicken played between the House and Senate,” said Dallas Harris, another lobbyist for Public Knowledge.

Finally, Flake scheduled the vote for March 22. It was not until then that the campaign against it took off.

The American Civil Liberties Union, Free Press and other groups delivered a petition with 100,000 signatures to Senate Majority Leader Mitch McConnell (R-Ky.) and other congressional leaders hours before the Senate began its debate on the bill.

When Senate Republicans passed the bill the following day on a narrow party-line vote, the issue finally exploded across the Internet and in mainstream, liberal and conservative media.

NBC, CNN, Fox and MSNBC carried stories about the vote. And conservative online platforms — such as Breitbart News and Reddit sites devoted to Trump — were packed with posts from Trump supporters who were angry about the bill.

More than 20,000 calls flooded House members’ office phone lines, and more than a dozen members of the House Freedom Caucus — a congressional group of conservative and libertarian Republicans — told Blackburn they probably would not vote for the bill, several Hill staff told The Washington Post.

Waltzman said the fight intensified: “Suddenly, we were dealing with flat-out lies. Members were saying, ‘These companies can see literally everything you do online.’ That is simply not true.”

Fearing more House Republicans could defect, Hill staff said, McConnell and other Republican leaders asked the Trump administration to issue a statement signaling that he would sign the bill. The White House staff did so.

Within hours, Blackburn introduced the bill on the House floor and called for a vote.

"Just last week I bought underwear on the Internet. Why should you know what size I take? Or the color? Or any of that information?” he yelled. (Video: C-SPAN)

Rep. Michael E. Capuano (D-Mass.) took to the floor, screaming: “What are you thinking? . . . Just last week I bought underwear on the Internet. Why should you know what size I take? Or the color? Or any of that information?”

Fifteen Republicans voted against the bill, but the measure still passed, 215 to 205.

See how your daily Internet activities translates to cash for ISPs, how much your data costs and how to protect yourself. (Video: Jhaan Elker/The Washington Post)

Alice Crites contributed to this report.