The US Supreme Court has upheld the law which aims to provide affordable health insurance for all Americans, dismissing a legal challenge from Texas and 17 other Republican-governed states.
This is the third time since 2010 that the Affordable Care Act (ACA), the signature policy of former president Barack Obama, has survived a challenge.
The law gave millions of low-income Americans access to medical insurance.
It bans insurers from denying coverage due to pre-existing conditions.
The justices ruled by a 7-2 majority that the challengers did not have the legal basis to sue, and as such did not address the question of whether a key provision in the law was unconstitutional.
The legal challenge was backed by former president Donald Trump, who promised to have the act repealed when he was elected in 2016.
Republicans tried and failed to overturn the law in Congress when they controlled both houses and in the courts on numerous occasions.
Earlier this month, the White House said a record 31 million Americans were now covered by healthcare under the ACA, which is popularly known as Obamacare.
What did the judges say?
Thursday's ruling left in place an Obamacare requirement known as the "individual mandate" - a provision instructing people to buy health insurance or face a tax penalty. But it's no longer much of a penalty: in 2017, a Republican-led Congress set the fine to $0.
The 18 Republican states involved in the suit argued that the law became unconstitutional once the penalty was eliminated.
The majority opinion was written by Stephen Breyer, the most senior liberal justice on the court.
He wrote: "The matter is not simply technical... It would threaten to grant unelected judges a general authority to conduct oversight of decisions of the elected branches of Government."
Conservative Justice Samuel Alito dissented from the majority, along with one Trump's appointee Neil Gorsuch.
"No one can fail to be impressed by the lengths to which this Court has been willing to go to defend the ACA against all threats," Alito wrote.
The ruling comes from the most conservative Supreme Court benches in decades, after Republican President Donald Trump nominated three justices in his four-year term.
What has the reaction been?
President Joe Biden applauded the news in a statement, calling the ruling a "major victory for all Americans benefitting" from the law.
It is also a win for Biden himself, who has made improved healthcare access central to his agenda and has promised to use his executive powers to expand the ACA.
"It is time move forward and keep building on this landmark law," his statement said.
To Republicans, the ACA represents a drastic - and costly - move towards socialised healthcare. They argue it increases expense but lowers the quality of care.
It has also been unpopular among the already-insured who saw coverage costs rise when sicker individuals were added to the pool.
In a tweet, Congressman Kevin Brady, a Texas Republican, said he was "disappointed" by the ruling and criticised the Supreme Court for having "stepped in" to save the "flawed" legislation.
But the law remains well-liked by many Americans - nearly 54% viewed it favourably, a February Kaiser Family Foundation poll found - and it has become increasingly intertwined with the country's healthcare system as a whole.
The act's rules barring insurers from denying coverage over pre-existing conditions and allowing children to stay on their parents' health plans until age 26 are among its most popular elements.
Top Democrat Nancy Pelosi, the Speaker of the House of Representatives, applauded the Court's decision during a Thursday news conference as a "landmark victory" for her party.