PHOENIX — The Arizona Legislature unanimously approved Gov. Doug Ducey’s proposal to crack down on excess opioid prescribing and add other regulations designed to cut down on addictions and overdose deaths.

Thursday’s action came despite a number of majority Republican lawmakers who had expressed deep concerns about parts of the proposal. The Republican governor was expected to sign it Friday.

Ducey’s proposal bars doctors from prescribing more than an initial five-day supply of pain medication in most cases, boosts pain clinic regulation and adds $10 million to help uninsured and underinsured people get addiction treatment. It requires electronic prescriptions for narcotics by early next year in large counties and by mid-2019 in smaller counties.

It also places limits on the maximum dose most chronic pain patients can be prescribed, and requires a consultation with a pain specialist for new high dosage prescriptions.

Republicans senators worried about unintended consequences on patients needing painkillers and on doctors who will soon need to consult with pain specialists in some cases and add new computer systems to write electronic prescriptions. Paper prescriptions would be banned to cut down on forgeries.

House Republicans voiced similar concerns about the costs to doctors and hospitals of putting the electronic prescription software in place. Health care providers in large counties would have to begin using the systems by Jan. 1, 2019, although an amendment allows a one-year waiver. Smaller counties get an extra six months.

“I feel like it’s not only an unfunded mandate for all these practitioners but I feel like the time frame is pretty quick,” said Rep. Regina Cobb, a Kingman dentist. “Especially when there’s companies that I work with daily that don’t even have the software.”

Minority Democrats hailed a $10 million appropriation allowing uninsured patients to get addiction treatment as a major win. But they called for more focus on drug crimes, noting that penalties in the state for drug possession are equal with manslaughter and too many people with drug problems are incarcerated instead of being offered treatment.

The bill also includes a “good Samaritan” provision that bars prosecution of someone who seeks help for an overdose victim if they’re discovered with drugs as a result. Similarly, an overdose victim can’t be prosecuted for drug possession when they call for help.

Republican Rep. Eddie Farnsworth objected, saying the provision was backed by a drug legalization group and lawmakers had no chance to object “because we’re ramming it through in a short period of time.

“They call it a good Samaritan law so that everybody feels good about it,” he said. “It’s a get out of jail free card.”

Backers of the provision say they’re trying to save lives.

The Republican governor has said he wants to protect people with chronic pain while trying to cut the number of new addictions. He declared an opioid emergency in June and the state Health Services Department put in place real-time overdose reporting rules. Between June 15 and Dec. 28, 2017, the department tracked more than 4,900 suspected overdoses and 716 suspected deaths.

Sen. Nancy Barto said during a meeting of GOP senators that she’s hearing from patients that doctors are unwilling to provide needed medicine.

“We’re already hearing from some patients where doctors are sending them somewhere else because they’re unwilling to prescribe because they’re afraid,” Barto said.

Sen. Sylvia Allen, the majority leader, said she views the bill as a massive new regulatory effort that is likely to have unintended consequences and is being rushed into law.

“I think it is happening way too fast,” she said, although she later said she’s likely to vote for the measure.

House Speaker J.D. Mesnard said he believes patients with chronic pain will not be affected but that the new safeguards were critically important.

Ducey called a special session of the Legislature on Monday and the bill language wasn’t available until that evening. On Tuesday and Wednesday, House and Senate committees took testimony.

“I’ll be frank — I agree with Sen. Allen,” Sen. John Kavanagh said. “I have real problems with this and I am not prepared to go forward.”

Allen and Kavanagh got pushback from Sen. Bob Worsley, who noted that there had been a 74 percent increase in opioid overdose deaths since he came into office in 2013.

“I don’t know why we’re suddenly getting weak-kneed about addressing this,” he told fellow GOP senators in the meeting. “It’s out of control.”

In the end, no one broke ranks and voted no on the proposal, despite their misgivings.

Ducey’s office negotiated with medical groups, lawmakers and others on the proposal, and it had bipartisan support in both chambers.