A Texas judge rules in favour of a case brought by Republican state attorneys general and governor.

A federal judge in Texas ruled Friday that the US health care law known as Obamacare is unconstitutional -a ruling that opposition Democrats vowed to appeal.

US District Judge Reed O’Connor’s ruling came in a lawsuit filed by several Republican state attorneys general and a governor opposed to the federal government health plan, known officially as the Affordable Care Act.

Conservative Republicans have long opposed the plan, signed into law by president Barack Obama in 2010.

The case is likely to reach the US Supreme Court, where the five justices in the nine-judge court who voted to uphold Obamacare in a separate case in 2012 are still on the bench.

President Donald Trump lost no time in tweeting his opinion on the case.

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

“As I predicted all along, Obamacare has been struck down as an UNCONSTITUTIONAL disaster!” he said.

Trump urged likely Democratic Speaker of the House Nancy Pelosi and Republican Senate Majority Leader Mitch McConnell to “pass a STRONG law that provides GREAT healthcare.”

Pelosi and Democratic Senate Minority Leader Chuck Schumer snapped back with angry statements.

The ruling “exposes the monstrous endgame of Republicans’ all-out assault on people with pre-existing conditions and Americans’ access to affordable health care,” Pelosi said.

While the court’s “absurd ruling will be immediately appealed, Republicans are fully responsible for this cruel decision,” she said.

According to Schumer, the ruling “seems to be based on faulty legal reasoning and hopefully it will be overturned.”

However if this “awful ruling is upheld in the higher courts, it will be a disaster for tens of millions of American families, especially for people with pre-existing conditions,” he said.