MANCHESTER, N.H. — Chad Diaz began using heroin when he was 12. Now 36 and newly covered by Medicaid under the Affordable Care Act, he is on Suboxone, a substitute opioid that eases withdrawal symptoms and cravings, and he is slowly pulling himself together.

“This is the best my life has gone in many, many years,” Mr. Diaz, a big man wearing camouflage, said as he sat in a community health center here.

If Congress and President Trump succeed in dismantling the Affordable Care Act, he will have no insurance to pay for his medication or counseling, and he fears he will slide back to heroin.

“If this gets taken from me, it’s right back to Square 1,” he said. “And that’s not a good place. I’m scary when I’m using. I don’t care who I hurt.”

As the debate over the fate of the health law intensifies, proponents have focused on the lifesaving care it has brought to people with cancer, diabetes and other physical illnesses. But the law has also had a profound, though perhaps less heralded, effect on mental health and addiction treatment, vastly expanding access to those services by designating them as “essential benefits” that must be covered through the A.C.A. marketplaces and expanded Medicaid.

The Center on Budget and Policy Priorities, a left-leaning research group, calculates that 2.8 million people with substance use disorders, including 220,000 with opioid disorders, have coverage under the A.C.A. As the opioid epidemic continues to devastate communities nationwide, public health officials say the law has begun to make a critical difference in their ability to treat and rehabilitate people.

Image

A bathroom sink full of old prescription bottles for sleeping pills, opioids and other drugs in Rainelle, W.Va.CreditMark Trent

“Of all the illnesses, this is one where we’ve seen very dramatic changes and where we stand to lose the most ground if we lose the A.C.A.,” said Linda Rosenberg, president and chief executive of the National Council for Behavioral Health, adding that treatment programs have begun to be integrated into primary care clinics and health care systems nationwide.

During the presidential campaign, Mr. Trump pledged to rid the country of Obamacare but also to address the opioid epidemic and expand access to drug treatment. Many of the states hardest hit by opioids — including Ohio, West Virginia and Kentucky — voted for Mr. Trump, but some Republican governors have expressed concern about what might happen to people being treated for addiction if their party repeals or scales back the health law.

John Kasich, the Republican governor of Ohio, where the Medicaid expansion has covered 700,000 people, has been particularly outspoken about its success in his state. “Thank God we expanded Medicaid because that Medicaid money is helping to rehab people,” Mr. Kasich said during a bill signing in January.

There is still a long way to go. Waiting lists for treatment persist, and many people still lack access, particularly in the 19 states that have opted not to expand Medicaid. Nationwide, 78 people die every day from opioid overdoses, according to the surgeon general, and the number is still rising. And paradoxically, even as the number of opioid prescriptions in the United States has finally started falling, expanded health coverage has probably made it easier for some people to obtain the drugs.

“There’s no doubt in my mind that improving access to health care during an era in which opioids are being overprescribed would lead to more addiction,” said Dr. Andrew Kolodny, the director of Physicians for Responsible Opioid Prescribing and an addiction specialist.

While 23 million Americans suffer from a substance use disorder, the surgeon general said in a report last year that only one in 10 was receiving treatment as of 2014, the first year people got coverage through the health law. “Now what we’re doing is playing catch-up,” said Michael Botticelli, director of the White House Office of National Drug Control Policy during the last two years of the Obama administration.

In the past, a third of private insurance plans sold on the individual market did not cover addiction treatment, according to federal health officials, and those that did imposed strict limits. Medicaid covered little besides inpatient detox. Now, more health care providers are offering and getting reimbursed for outpatient counseling and medications like Suboxone and Vivitrol, which have been shown to reduce the potential for relapse.

Video

With President Trump in office, the goal of repealing the Affordable Care Act is finally within reach for Republicans. Margot Sanger-Katz explains why repealing and replacing Obamacare may not be easy.CreditCreditStephen Crowley/The New York Times

The health law encourages primary care doctors to incorporate addiction treatment into their practices. It provided grants to several hundred community health centers around the country, many in rural areas, to begin or expand mental health and medication-assisted treatment, which combines counseling and drugs like Suboxone.

This is a big improvement from the days when treatment typically was offered through scattered, poorly funded stand-alone clinics that did not necessarily provide evidence-based treatment and had long waiting lists, said Richard Frank, a professor of health economics at Harvard Medical School.

“The whole system is being pushed more toward looking like modern health care,” said Dr. Frank, who worked at the Department of Health and Human Services in the Obama administration.

The 21st Century Cures Act, which Congress passed in December with strong bipartisan support, could build on the progress by providing $1 billion nationwide over the next two years to expand drug treatment around the country, with an emphasis on medication-assisted treatment. The federal government will soon begin distributing the money to states, which will allot it to treatment programs, particularly in high-need areas. But if people lose their insurance, Dr. Frank said, they may well lose access to these new options.

In Kentucky about 11,000 people were receiving addiction treatment through Medicaid by mid-2016, up sharply from 1,500 people in early 2014, according to the Foundation for a Healthy Kentucky, a health policy research group. In West Virginia, Ms. Rosenberg of the National Council for Behavioral Health said, her group’s member organizations — nonprofit providers of mental health and addiction treatment — are now treating 30,000 people a year, up from 9,000 before the health law.

Here in New Hampshire — which Mr. Trump won resoundingly in the Republican primary and lost by a hair in November — more than 10,000 people have received addiction treatment after gaining coverage through the Medicaid expansion, said Michele Merritt, senior vice president and policy director at New Futures, a nonprofit advocacy group. Small treatment centers throughout the state that had never been able to bill insurance before have started doing so, she said, allowing them to hire more counselors and accept more patients.

“We’re just beginning to implement these exchanges in a way that people know about them,” said Senator Jeanne Shaheen, a New Hampshire Democrat, referring to the exchanges created under the health law. Getting rid of them, she said, “makes no sense.”

Others note that even with more treatment options, the number of deaths in places like New Hampshire continues to rise. The state ranks first nationwide in per capita overdose deaths from fentanyl, a powerful synthetic opioid that is now killing more people here than heroin. Republicans here have also criticized state health officials for not tracking how many Medicaid enrollees who receive addiction treatment end up relapsing.

In Pennsylvania, where 124,000 people have received addiction treatment under the Medicaid expansion, health officials were disturbed by early data showing that two-thirds of those who went to detox got no other treatment services. So Gov. Tom Wolf, a Democrat, is designating 45 “Centers of Excellence” — primary care clinics where people can also get addiction and mental health treatment, with frequent follow-up and a team of providers closely tracking their progress.

The new model is in use here at the Manchester Community Health Center, where Mr. Diaz receives treatment. The center had offered minimal services for substance abuse before the health law.

Now, three years later, it has undergone substantial changes. More than 40 percent of its patients had been uninsured; today, only 20 percent are. The center used to have one building, a staff of 55 and 7,500 patients; today, it has clinics in four locations, a staff of 230 and more than 16,000 patients, about 800 of whom have substance abuse issues.

It has two providers who are licensed to prescribe medication-assisted treatment, which it is expanding to 60 patients, including pregnant women, the center’s priority. “The number may sound low as far as how many we’re treating,” said Julie Hazell-Felch, director of behavioral health at the center. “But it’s a multitude of services they’re receiving and they’re in here weekly,” she said, seeing nurses, a behavioral health clinician and a medical provider, and giving urine samples and receiving their medications.

If the Affordable Care Act is repealed, the center stands to lose more than $6 million in funding, mostly Medicaid revenue, about a third of its $18 million annual budget.

“We would not be able to keep all four sites open,” said Kris McCracken, president and chief executive of the health center.

She added: “There are only two avenues to go: You either prevent and treat, or you street. That’s what will happen. People will end up back on the street.”

A version of this article appears in print on , Section A, Page 1 of the New York edition with the headline: Without Health Law, Addicts Could Have the Most to Lose. Order Reprints | Today’s Paper | Subscribe