With Republicans and Democrats joining forces again in a bipartisan effort to target the U.S. opioid crisis, an Associated Press analysis of the first wave of emergency money from Congress finds that states are taking very different approaches to spending it.

To a large extent, the differences depend on whether states participated in one of the most divisive issues in recent American politics: the health overhaul known as “Obamacare.”

The AP analysis found states that expanded Medicaid under President Barack Obama’s health overhaul reported spending their allocations more slowly than states that didn’t expand the health insurance program to poor, childless adults.

Why? In states that expanded Medicaid, the insurance program already covers addiction treatment for nearly everyone who is poor and needs it.

Medicaid allows states to go beyond the basics with the grant money, while non-expansion states have to fill in for basic needs with fewer dollars, said Brendan Saloner, an addiction researcher at Johns Hopkins Bloomberg School of Public Health. In effect, Medicaid expansion states had a running start on the opioid crisis, while states without the extra Medicaid funding hastened to catch up.

“Non-expansion states are dealing with populations more likely to be uninsured and more likely to need coverage for addiction treatment,” Saloner said. In contrast, states with Medicaid expansion can use the grants to create new infrastructure, “asking providers to take risks by investing in new personnel, new systems and new ways of doing things,” Saloner said. “The puzzle is how to keep momentum going after the funds are gone.”

The Medicaid insurance expansion gives states a head start because they have “a coordinated, reliable and consistent source of coverage” for a demographic group hit hard by addiction, said Trish Riley, executive director of the National Academy for State Health Policy. “It’s not grant funded. It’s not stopgap,” Riley said.

“Coverage matters, period,” Riley said.

Thirty-three states have expanded Medicaid, receiving enhanced federal funding to cover poor adults. Historically, Medicaid has covered a large share of all addiction treatment in the U.S., more than all private insurance combined. Medicaid covers 4 out of 10 adults under age 65 with opioid addiction.

On Election Day, voters in Idaho, Nebraska and Utah will decide whether their states should expand Medicaid. Montana voters will decide on maintaining that state’s expansion.

The emergency money from Congress was part of a two-year, nearly $1 billion grant program. It was distributed according to a formula favoring states with more overdose deaths and treatment needs. California received nearly $45 million. Texas got $27.6 million. Florida got $27.2 million.

States spent the money at different paces and on different services, the AP found. In total, states used the money to provide treatment to nearly 119,000 people with opioid addiction, including nearly 3,000 pregnant women. More than 33,000 people received recovery services, such as training and housing.

In Massachusetts, with Medicaid expansion already paying for treatment, the grant goes largely toward such recovery services. Phillip Oliver, a 48-year-old who has struggled with addiction since his early teens, is training to work in the restaurant industry; his tuition is covered by the grant.

Michael Robinson, who is in recovery from heroin addiction, got a care services coordinator, a $500 benefit and a six-week training program in construction. Two months ago, the 25-year-old became a union carpenter and has been working on building projects across the Boston area since.

“It’s a great thing they’re doing,” Robinson said. “The reason a lot of people stay getting high is they have nothing to look forward to. They don’t have the jobs skills and the streets are all they know.”

Tennessee, which has not expanded Medicaid, is spending its grant at a quicker pace than most other states, filling empty slots at treatment facilities that were instantly ready for more clients. One is Buffalo Valley Inc. with 14 locations around the state.

Thanks to the federal grant, Buffalo Valley is treating an additional 1,000 people a year with opioid addiction and without insurance. People like Tim Nolen, 36, of Nashville.

“I see it as a blessing,” said Nolen, who after years addicted to pain pills is making progress with medication and counseling. “The biggest thing for me was, not having insurance, I could still get help and I didn’t have to go bankrupt to get it.”

The 12 months of spending totaled $270 million, a portion of the $1 billion Congress approved in 2016 to address opioid addiction under the 21st Century Cures Act.

To compare states, AP obtained year-end reports and analyzed actual expenditures from May 2017 through April 2018. States were required to report on money actually spent, not what they intended to spend.

In some states, structural delays — choosing contractors through competitive bidding, for example — led to less time for invoices to be submitted and paid by the end of the period. California officials said such processes and a deliberate effort to build an entirely new treatment structure explain why the state still had $41 million of its grant left after the first 12 months.

The AP analysis found:

—States that did not expand Medicaid spent $2,645 per patient on opioid addiction treatment on average. Expansion states spent $1,581 per patient for treatment.

—States that did not expand Medicaid spent $1,170 per person served on recovery support services. Expansion states spent $446 per person served on recovery.

—States that did not expand Medicaid spent 71 percent of their grant money in the first year. Expansion states spent 59 percent of their grant money. States can get permission to carry over unspent money into the next year.

Virginia and Maine were counted as non-expansion states in AP’s analysis because neither state’s expansion was implemented in time to affect grant spending.

Federal officials said states had some leeway in how they categorized money spent but also got some guidance. For instance, states were instructed to categorize the opioid overdose drug naloxone under the “treatment” category.

It’s too early to pinpoint whether the spending may be helping solve the crisis. The Trump administration has said a recent survey shows efforts are working. Fewer people used heroin in 2017 for the first time than the previous year. Fewer were misusing or addicted to prescription opioid painkillers. And more people were getting treatment for heroin and opioid addiction. The Centers for Disease Control and Prevention has released preliminary figures that appear to show a leveling off in overdose deaths.

In the shadow of the bitter fight over Brett Kavanaugh’s Supreme Court confirmation, Congress passed the bipartisan Support for Patients and Communities Act, which includes multiple provisions to address the opioid crisis and reauthorizes the Cures Act grants through 2021. President Donald Trump is expected to sign the measure.