A U.S. federal appeals court on Friday upheld a law requiring Chinese-based ByteDance to divest its popular short video app TikTok in the United States by early next year or face a ban.

The decision is a major win for the Justice Department and opponents of the Chinese-owned app and a devastating blow to TikTok parent ByteDance. It significantly raises the prospects of an unprecedented ban in just six weeks on a social media app used by 170 million Americans.

TikTok plans to appeal the decision to the Supreme Court.