In a 55-page opinion, U.S. District Judge Reed O'Connor ruled that last year's tax cut bill knocked the constitutional foundation from under "Obamacare" by eliminating a penalty for not having coverage.

Supporters of the law immediately said they would appeal.

California Attorney General Xavier Becerra, who has been leading the multistate coalition to defend the law, issued a statement saying: "The ACA has already survived more than 70 unsuccessful repeal attempts and withstood scrutiny in the Supreme Court. Today's misguided ruling will not deter us: our coalition will continue to fight in court for the health and wellbeing of all Americans."

Becerra called Friday's ruling "an assault on 133 million Americans with preexisting conditions, on the 20 million Americans who rely on the ACA's consumer protections for healthcare, on America's faithful progress toward affordable healthcare for all Americans."

President Donald Trump hailed the ruling, tweeting: "As I predicted all along, Obamacare has been struck down as an UNCONSTITUTIONAL disaster! Now Congress must pass a STRONG law that provides GREAT healthcare and protects pre-existing conditions."

But Rep. Nancy Pelosi, who is expected to become House speaker in January, vowed to fight what she called an "absurd ruling." She said the House "will move swiftly to formally intervene in the appeals process to uphold the life-saving protections for people with pre-existing conditions and reject Republicans' effort to destroy the Affordable Care Act."

White House press secretary Sarah Huckabee Sanders issued a statement saying: "We expect this ruling will be appealed to the Supreme Court. Pending the appeal process, the law remains in place."

Twenty Republican-led states brought the lawsuit. After Trump ordered the Justice Department to stop defending the health law, a coalition of ACA-supporting states took up the defense.

O'Connor is a conservative Republican appointee who has previously blocked other Obama-era policies.