A federal judge in Texas struck down the Affordable Care Act on Friday night, ruling that former President Barack Obama's signature domestic legislation has fallen down like a losing game of "Jenga."

But the White House said that with the ruling expected to be appealed to the U.S. Supreme Court, the law will remain in place for now.

U.S. District Judge Reed O’Connor in Fort Worth sided with the argument put forward by a coalition of Republican-leaning states, led by Texas, that Obamacare could no longer stand now that there's no penalty for Americans who don't buy insurance.

The U.S. Supreme Court had upheld the law in 2012, by classifying the legislation as a tax. But since Congress removed the individual mandate in 2017, O’Connor ruled, there's no way the ACA can be allowed to stand.

"The Individual Mandate can no longer be fairly read as an exercise of Congress's Tax Power and is still impermissible under the Interstate Commerce Clause — meaning the Individual Mandate is unconstitutional," O'Connor wrote. "The Individual Mandate is essential to and inseverable from the remainder of the ACA."

Without the system being upheld by a wide pool of mandated participants, the ACA cannot stand, O'Connor ruled.

"Without it, Congress and the Supreme Court have stated, the architectural design fails," according to O'Connor. "It is like watching a slow game of Jenga, each party poking at a different provision to see if the ACA falls."

President Donald Trump tweeted his approval of the ruling Friday night.

"Wow, but not surprisingly, ObamaCare was just ruled UNCONSTITUTIONAL by a highly respected judge in Texas. Great news for America!" he wrote.

Wow, but not surprisingly, ObamaCare was just ruled UNCONSTITUTIONAL by a highly respected judge in Texas. Great news for America! — Donald J. Trump (@realDonaldTrump) December 15, 2018

But Trump urged soon-to-be Speaker of the House Nancy Pelosi and Senate Majority Leader Mitch McConnell to revamp the ACA and keep its most popular provisions, such as protections for patients with pre-existing conditions.

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. Mitch and Nancy, get it done! — Donald J. Trump (@realDonaldTrump) December 15, 2018

"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. Mitch and Nancy, get it done!" Trump wrote.

Senate Minority Leader Chuck Schumer called it an "awful ruling" and said that if it is upheld in higher court, "it will be a disaster for tens of millions of American families, especially for people with pre-existing conditions."

Pelosi said Friday’s ruling "exposes the monstrous endgame of Republicans’ all-out assault on people with pre-existing conditions and Americans’ access to affordable health care” and vowed action in the House when the new Congress convenes.

"When House Democrats take the gavel, the House of Representatives 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,” Pelosi said in a statement.

States who fought the Republican effort to undercut the ACA vowed to keep fighting.

"Today’s ruling is an assault on 133 million Americans with pre-existing conditions, on the 20 million Americans who rely on the ACA for healthcare, and on America’s faithful progress toward affordable health care for all Americans,” California Attorney General Becerra said in a statement Friday night.

"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 well-being of all Americans."

O'Connor's decision came down just before the program's enrollment period ends on Saturday. But with appeals forthcoming, the ruling is not expected to immediately affect the millions of Americans signing up for coverage through the ACA.

"Obamacare has been struck down by a highly respected judge," White House press secretary Sarah Sanders said in a statement after the ruling. "The judge’s decision vindicates President Trump’s position that Obamacare is unconstitutional. Once again, the president calls on Congress to replace Obamacare and act to protect people with preexisting conditions and provide Americans with quality affordable healthcare."

"We expect this ruling will be appealed to the Supreme Court. Pending the appeal process, the law remains in place," Sanders said in the statement.