The Texas judge who ruled ObamaCare unconstitutional earlier this month agreed late Sunday to stay his decision from taking effect until the case can be appealed.

Federal Judge Reed O’Connor said he didn’t believe 17 state attorneys general, led by California’s Xavier Becerra, would prevail in their challenge of his ruling, which came one day before the end of the program’s annual six-week enrollment period..

“But because many everyday Americans would otherwise face great uncertainty during the pendency of appeal, the Court finds that the December 14, 2018 Order declaring the Individual Mandate unconstitutional and inseverable should be stayed,” he wrote in the 30-page order.

O’Connor struck down former President Barack Obama’s signature health insurance law on grounds that the law became “invalid” when Congress voted last year to eliminate the tax penalty for anyone without coverage.

The judge’s decision threatened to cancel health insurance coverage for about 20 million Americans, and also end popular provisions that guarantee insurance to people with pre-existing conditions and allow children to remain on their parents’ policies until they turn 26.

In a tweet posted Sunday evening, Becerra vowed to fight to preserve ObamaCare.

“A federal court in #Texas granted what we asked for in a Dec. 17 motion but at the end of the day, we’re working to keep #healthcare affordable and accessible to millions of Americans, so we march forward!” he wrote.