WASHINGTON—The Senate passed by unanimous consent a bill that would ban federal employees from downloading or using the social-media app TikTok on government devices, in the face of mounting national-security concerns.

The legislation would still have to pass the House and be signed by the president to become law. A similar bill passed the Senate in a previous Congress but never moved forward in the House. 

U.S. officials and lawmakers from both parties have raised concerns about the app’s owner, Beijing-based ByteDance Ltd. In just five years, the application, which allows users to post short videos with music, has exploded into a pop-culture phenomenon. It is the world’s most popular app, used by two-thirds of American teens.

Sen. Josh Hawley (R., Mo.) co-sponsored the legislation with Sens. Rick Scott (R., Fla.), Marco Rubio (R., Fla.) and Tom Cotton (R., Ark.). 

TikTok has repeatedly said that it has never shared U.S. user data with the Chinese government and wouldn’t if asked.

TikTok spokesperson Brooke Oberwetter said Mr. Hawley’s bill “does nothing to advance U.S. national security interests. We hope that rather than continuing down that road, he will urge the administration to move forward on an agreement that would actually address his concerns.”

Biden administration officials have been negotiating with TikTok executives on measures aimed at preventing information TikTok collects on American users from being shared with Beijing.

“TikTok is a Trojan Horse for the Chinese Communist Party. It’s a major security risk,” said Mr. Hawley in a statement after the bill passed. He said that until TikTok “is forced to sever ties with China completely, it has no place on government devices.”

A spokesman for House Speaker Nancy Pelosi

(D., Calif.) didn’t immediately respond to a question on whether the bill would be brought up in the House before the new Congress begins next year.

Texas Gov. Greg Abbott, a Republican, banned last week the use of TikTok on government-issued devices, citing national security concerns that the app could be used to help China surveil Americans and U.S. intelligence officials. Other states have begun taking similar steps.

On Tuesday, Mr. Rubio and Reps. Mike Gallagher (R., Wis.) and Raja Krishnamoorthi (D., Ill.) introduced legislation in both chambers aimed at banning TikTok from operating in the U.S.

The app is currently going through a national security review process with the Committee on Foreign Investment in the U.S., a federal panel that oversees cross-border mergers and acquisitions, also known as Cfius. A TikTok executive who was grilled by senators in September said the final agreement with Cfius would “satisfy all national security concerns.”

In June, TikTok said it was routing all U.S. user data through

Oracle Corp.

Indiana filed a pair of lawsuits against TikTok earlier this month, alleging the platform is deceiving consumers about its content and data security, the latest in a growing number of moves by state officials to push back against the platform’s influence on children and its connections to China.

The state said its lawsuits are the first of their kind against the popular app and ByteDance. In one of the complaints, Indiana alleged that TikTok’s algorithm is designed to addict young users and promotes harmful content that isn’t appropriate for them. The lawsuit cites studies and reports linking heavy use of the platform to mental disorders among teenagers, including eating disorders and depression.

TikTok declined to comment on the lawsuits but said: “The safety, privacy and security of our community is our top priority. We build youth well-being into our policies, limit features by age, empower parents with tools and resources, and continue to invest in new ways to enjoy content based on age-appropriateness or family comfort.”

In 2020, the Trump administration unsuccessfully tried to stop U.S. phone users from downloading TikTok as part of a crackdown on Chinese apps, citing privacy and security concerns.

TikTok’s lawyers argued at the time that a download ban could irreparably harm the app’s business. U.S. District Judge Carl Nichols agreed and determined that the government likely overstepped its authority under a 1970s national-security law, which grants the president broad power to act on threats to the U.S. economy and foreign policy but prohibits restrictions on exchanges of informational materials.

Write to Meghan Bobrowsky at meghan.bobrowsky@wsj.com and Eliza Collins at eliza.collins@wsj.com