(CNN) — TikTok will file a court challenge if Congress passes legislation paving the way to a nationwide ban of the app, a top executive told employees in an internal memo obtained by CNN.

On Saturday the House of Representatives passed a foreign aid package containing language that could lead to a ban of TikTok — and the bill could pass the Senate within days, Michael Beckerman, TikTok’s head of public policy for the Americas, warned employees in the memo he sent the same day.

“At the stage that the bill is signed [by President Joe Biden], we will move to the courts for a legal challenge,” Beckerman wrote to staff, describing the legislation as “an unprecedented deal worked out between the Republican Speaker [Mike Johnson] and President Biden.”

“This is the beginning, not the end of this long process,” Beckerman added. He invited employees to an internal town hall scheduled for Wednesday “for additional context.”

The memo was earlier reported by The Information. A TikTok spokesperson didn’t immediately respond to a request for comment.

The legislation calls for forcing TikTok’s Chinese parent, ByteDance, to sell the app within 270 days — otherwise it would be illegal for US app stores to offer TikTok for downloads. The legislation also would allow Biden to extend that deadline by another 90 days if he determines there’s been progress toward a sale.

Foreshadowing its legal strategy, TikTok has already publicly opposed the bill as an infringement on its users’ First Amendment rights. Supporters of the legislation, by contrast, have said it is a necessary measure to protect Americans’ personal data and have pushed back on characterizations of it as a flat-out ban.

Some legal experts on the First Amendment have suggested TikTok could have a case, noting that courts have tended to look at the ultimate impacts of challenged laws on Americans’ speech and not just their stated intent.

(Copyright (c) 2024 CNN. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox