House Minority Leader Rep. Nancy Pelosi (D-CA) speaks during a Stop 'Trumpcare' rally May 4, 2017 in front of the Capitol in Washington, DC. Congressional Democrats joined activists for a rally to urge not to replace Obamacare, also known as the Affordable Care Act.

The federal judge in the case, U.S. District Court Judge Reed O'Connor, ruled on Dec. 14 that the Affordable Care Act, more commonly known as Obamacare , was unconstitutional. At the same time, he is allowing the law to remain in effect while his ruling is being appealed.

In an action Tuesday night, Democratic leaders said they will authorize their next speaker, likely Nancy Pelosi , to intervene in a pending federal case, Texas v. United States, in which a judge has ruled Obamacare unconstitutional. Democrats regain control of the House when Congress returns for the 116th congressional session Thursday.

Democrats about to take over control of the House of Representatives have moved to defend Obamacare from a court challenge that threatens to kill the landmark health-care reform law.

O'Connor's ruling argued that the health-care law cannot stand on its own since Congress last December essentially eliminated a key provision, the so-called individual mandate, which imposed a tax penalty on consumers who don't have health insurance. The mandate, which remained in effect for 2018, was a cornerstone of the ACA legislation. The mandate is the greater of $695 person per adult, or 2.5 percent of household income.

The U.S. Supreme Court has previously upheld the law under Congress' taxation power, and several Wall Street analysts expect the latest ruling in Texas to be overturned.

The move by the Democrats stands in stark contrast to a lawsuit the House filed in 2014, when Republicans were in control of the chamber, to challenge a key component of the Obamacare program. In that case, the House sued the secretary of the Health and Human Services Department, claiming the Obama administration was violating the law by continuing to reimburse insurers for subsidies given to customers to help reduce the cost of their out-of-pocket health expenses.

In that case, the House said the administration was violating the Constitution by spending money without congressional authorization. A federal judge ruled in the House's favor, but the case was being appealed by the Justice Department at the time a settlement was reached between the House and the Trump administration in late 2017.

That settlement dismissed the suit but still allowed the House to launch similar challenges in the future. At that point, the issue at the center of the case was effectively moot since the Trump administration had on its own stopped paying the insurers for the cost-sharing subsidies the insurers are mandated to offer under Obamacare.

Health-care stocks fell in the first trading day after the Texas judge's ruling, with the Health Care Select Sector SPDR (XLV) declining 2 percent.

A coalition of Democratic state attorneys general, led by California's Xavier Becerra, intend to appeal. Congressional Democrats also plan to appeal.

Becerra called the Texas 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."

More than $600 billion in federal funding for health care is on the line, the states said. In addition, an invalidation of the law would cause 12 million Americans to lose their insurance and strip 8 million low-income individuals of billions of dollars in tax credits.

President Donald Trump, who failed to rally enough Republicans to repeal and replace the health law in 2017, has applauded the federal judge's ruling, and called on Congress to replace it with a new bill.

— CNBC's Tucker Higgins and Dan Mangan contributed to this report.

WATCH: Health care stocks to watch in 2019