A tiny group of lawmakers huddled in private about a year ago, aiming to keep the discussions away from TikTok lobbyists while bulletproofing a bill that could ban the app.

Just over a year ago, lawmakers displayed a rare show of bipartisanship when they grilled Shou Chew, TikTok’s chief executive, about the video app’s ties to China. Their harsh questioning suggested that Washington was gearing up to force the company to sever ties with its Chinese owner — or even ban the app.

Then came mostly silence. Little emerged from the House committee that held the hearing, and a proposal to enable the administration to force a sale or ban TikTok fizzled in the Senate.

But behind the scenes, a tiny group of lawmakers began plotting a secretive effort that culminated on Tuesday, when the Senate passed a bill that forces TikTok to be sold by its Chinese owner, ByteDance, or risk getting banned. The measure upends the future of an app that claims 170 million users in the United States and that touches virtually every aspect of American life.

For nearly a year, lawmakers and some of their aides worked to write a version of the bill, concealing their efforts to avoid setting off TikTok’s lobbying might. To bulletproof the bill from expected legal challenges and persuade uncertain lawmakers, the group worked with the Justice Department and White House.

And the last stage — a race to the president’s desk that led some aides to nickname the bill the “Thunder Run” — played out in seven weeks from when it was publicly introduced, remarkably fast for Washington.

“You don’t get many opportunities like this on a major issue,” said Representative Steve Scalise of Louisiana, the Republican majority leader. He was one of 15 lawmakers, aides and officials directly involved in shaping and passing the bill who were interviewed for this article.

We are having trouble retrieving the article content.

Please enable JavaScript in your browser settings.


Thank you for your patience while we verify access. If you are in Reader mode please exit and log into your Times account, or subscribe for all of The Times.


Thank you for your patience while we verify access.

Already a subscriber? Log in.

Want all of The Times? Subscribe.