The ruling on Friday night by US District Judge Reed O'Connor of Texas overturns all of the 2010 healthcare law nationwide, reports The Washington Post.
In his opinion, Judge O'Connor said: "(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."
He also held that the individual mandate is "essential to and inseverable from the remainder of the ACA".
The ruling came on the eve of the deadline for Americans to sign up for coverage in the federal insurance exchange created under the law.
A spokeswoman for California Attorney General Xavier Becerra, who leads a group of states opposing the lawsuit, said on Saturday that the Democratic defenders of the law were ready to challenge the ruling in the US Court of Appeals for the 5th Circuit, New Orleans.
Legal experts have said that the law will remain in effect for now, but the invalidation of the landmarklegislation throws into doubt the future of health coverage for millions of Americans on the Obamacare exchanges and in Medicaid expansion, CNN said.
More than 4 million people have already signed up for 2019 coverage on the exchanges and millions were expected to pick plans before open enrollment ends on Saturday.
The case against the ACA was brought by 20 Republican state attorneys general and governors, as well as two individuals.
It revolves around Congress effectively eliminating the individual mandate penalty by reducing it to $0 as part of the 2017 tax cut bill.
The Republican coalition is arguing that the change rendered the mandate itself unconstitutional.
They say that the voiding of the penalty, which takes effect next year, removes the legal underpinning the Supreme Court relied upon when it upheld the law in 2012 under Congress' tax power.
The mandate requires nearly all Americans to get health insurance or pay a penalty.
President Donald Trump, who has always opposed the ACA, immediately celebrated the ruling via Twitter, saying Congress must now act, reports CNN.
"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.
"Wow, but not surprisingly, ObamaCare was just ruled UNCONSTITUTIONAL by a highly respected judge in Texas. Great news for America!"