The Affordable Care Act, the landmark health law that has been a subject of caustic debate for more than a decade, is being tested as never before, as millions of Americans lose their jobs and medical coverage in the midst of the nation's gravest health crisis in a century.

The law is offering a vast majority of newly unemployed people a path to stopgap health coverage, providing a cushion that did not exist during the last crushing recession — or ever before. But the crisis has also highlighted fundamental weaknesses with its patchwork system — ones magnified by Republican efforts to undermine and dismantle it but also seized on by some Democrats pushing for a sweeping overhaul.

On Thursday, as the coronavirus pandemic surged and the country reported a daily record in new virus cases, the Trump administration continued the Republican Party's push to abolish the law. Shortly before midnight, the Justice Department filed a brief asking the Supreme Court to overturn the law, in a case brought by a group of Republican attorneys general.

The case is likely to be argued this fall during the closing stages of a bitter presidential election in which health care is certain to be a galvanizing issue. Joe Biden, the presumptive Democratic nominee, continues to support improving and expanding the ACA with an option to buy a public plan, rather than replacing it with a Medicare for All system preferred by many in the left wing of the party.

As those political and legal battles play out, how the law actually works in the coming months of intense need could go a long way toward determining its durability and future.

"This is the first test of the ACA in an economic downturn," said Peter V. Lee, executive director of Covered California, the state's insurance marketplace created under the law. "But it's not just a test — it's a national study of what happens in states that implemented the ACA as opposed to those that didn't."

Four out of every five people who have lost employer-provided health insurance during the coronavirus pandemic are eligible for free coverage through expanded Medicaid programs or government-subsidized private insurance, according to the Kaiser Family Foundation, a nonpartisan health research group. And many jobless 20-somethings have been able to join their parents' plans. All three options were made possible by the law.

Yet others have fallen through the holes in the law's safety net. Nearly 3 million low-income people are ineligible for assistance in the 14 states that have declined to expand Medicaid under the law, including Texas, Florida and others, mostly in the South, where coronavirus cases are now spiking. Many people who have qualified for government subsidies to buy private plans still face unaffordable copays and deductibles.

David Exum, of Kannapolis, N.C., has experienced both the benefits and the shortcomings of the law. He lost his health coverage when he was laid off from his job as a web content coordinator in March. He is now paying just $1 a month for a subsidized plan.

It is a big improvement from the last recession, he said, when he became uninsured for several years after losing his job and getting divorced. But for Exum, 53, the law is imperfect.

His plan is cheap because it has a high deductible — $6,900 a year. Worse, if his unemployment benefits expire before he finds a new job, and his income drops below the poverty line, he will lose his premium subsidies and will no longer be able to afford the plan. But because of a quirk in the law, he would not be eligible for Medicaid in that situation, because North Carolina has not expanded the program to cover many low-income men.

"I know there are millions in the same boat," said Exum. "It's just really scary."

The strange glitch exists because the law originally required all states to expand Medicaid and thus did not set up a system of subsidies for the poorest Americans to buy private coverage. The Supreme Court ultimately ruled that states could opt out of expanding Medicaid, but Congress, bitterly divided over the law, never fixed the glitch.

The ACA brought the country's uninsured rate down to record lows several years after it was enacted in 2010, but even before the pandemic some 28 million people had no coverage. Still, an analysis by the Kaiser Family Foundation estimated that 27 million Americans could have lost job-based health coverage between March and May and that a vast majority of them — 79% — are eligible for new coverage from Medicaid or subsidized private plans.

In the 36 states that expanded Medicaid, the Kaiser analysis predicted that 14 million people would qualify for the free program and another 3.5 million would qualify for subsidized ACA plans.

Some states are already seeing spikes in Medicaid enrollment — in May alone, enrollment jumped by 8.4% in Minnesota and by 8.2% in Kentucky, according to the Georgetown Center for Children and Families — and experts anticipate bigger jumps, straining state budgets, in the coming months. So far, during the pandemic, nearly 800,000 people have signed up for new private plans through the law's marketplaces.

In Boise, Idaho, Jeremy Bratsman was laid off from his job as a regional manager in January and was still searching for work when the economy started shutting down in March. Bratsman, 43, has Type 1 diabetes; a few years ago, he paid $15,000 for insulin and other supplies over the course of a year while uninsured. Now, though, he qualifies for Medicaid with his wife and four sons because Idaho expanded the program in January.

"I've talked to other uninsured diabetics," his wife, Rebecca Bratsman, said. "And when they are in one of those states that hasn't expanded, I just tell them to move. They don't have any option."

In states that do not run their own ACA marketplaces, Republican efforts to weaken the law have made enrollment in new private plans during the pandemic more challenging. For example, the Trump administration all but eliminated funding for outreach in those states, including grants to nonprofit organizations that help people enroll in new coverage. Anyone who becomes uninsured after losing a job is eligible to sign up for a marketplace plan for 60 days afterward, but the administration has done little to raise awareness.

Morgan Childers, of Cullowhee, N.C., tried navigating the federal marketplace's website, HealthCare.gov, after she lost her job at a university in late March. Her income was low enough to qualify for premium subsidies, but she did not figure that out and mistakenly thought her cheapest option would cost $610 a month.

So Childers, 30, signed up for COBRA, which lets laid-off workers stay on their former employer's health plan for 18 months under federal law but requires them to pay the full cost unless the employer chooses to help. She is paying $560 a month — substantially more than a subsidized plan would cost at her income level, and an amount she will not be able to afford for long. She has several autoimmune conditions, and without insurance, would owe at least $3,000 a month just for her oral medications; she also gets regular infusions that cost even more.

"If my unemployment runs out and I don't have a job," she said, "I don't know what I'll do."

In contrast, most of the 13 states that operate their own ACA marketplaces not only opened enrollment to everyone during the pandemic but worked hard to publicize the option. In California, where the special enrollment period started March 15 and was recently extended through the end of July, the marketplace devoted $9 million to advertising the opportunity, including two television spots. People on unemployment get a flier advertising the marketplace with every check, and dozens of community groups help people enroll. So far, more than 175,000 have done so.

In the District of Columbia, where the special enrollment period will extend through September, the marketplace is contacting businesses that are cutting jobs to offer affected employees help applying for Medicaid or premium subsidies. In Maryland, where the marketplace just extended its special enrollment period through July 15, people can check a box on their tax form to find out if they are eligible for free or subsidized coverage.

A new report from the Trump administration said that, by the end of May, about 487,000 people who had lost their job-based coverage had signed up through the federal marketplace.

Unlike during the last recession, many employers are trying to maintain coverage for workers whom they have furloughed or laid off, hoping they can bring them back when the economy improves. About half of employers, asked in an April survey whether they planned to continue paying for health benefits for furloughed employees, said they would for a month or longer, according to an informal survey from Mercer, a benefits consultant.

There are no estimates of how many newly jobless people have enrolled in COBRA. Many employers are pushing Congress to pay people's premiums under COBRA during the pandemic so workers can keep the coverage they had through work. Proponents — including Republican opponents of the Affordable Care Act — say the idea is gaining momentum and could be included in the next coronavirus legislation. The latest estimate for the cost of covering the premiums in full is $98 billion.

But House Democrats are also pushing an alternative: a bill that would increase federal premium subsidies to buy plans through the ACA marketplaces and make them available to people who earn more than 400% of the poverty level, the current cutoff for assistance. The legislation mirrors what Biden has proposed. It has no chance of passing the Republican-controlled Senate, but Democrats hope it will bolster their election-year case against Trump and other Republicans.