The U.S. Court of Appeals for the D.C. Circuit on Friday upheld a law forcing video-sharing app TikTok to either be sold or shut down in the United States.

Chief Judge Sri Srinivasan and Judges Neomi Rao and Douglas Ginsburg rejected TikTok’s First Amendment challenge to the statute, saying legislators’ national security concerns about the app’s Chinese ties justify speech restrictions. TikTok is owned by Beijing-based ByteDance.