Boston would be granted 75 new liquor licenses, helping to spread the local restaurant boom beyond the downtown core, under a bill approved early Friday as lawmakers scrambled to finish major legislation on the final night of their formal session.
As frenzied lawmakers worked past a midnight deadline, they also passed a bill designed to combat the state's opioid crisis, including controversial provisions that curtail insurers' ability to deny coverage for addiction treatment.
Other measures sent to the governor would tighten the state's already stringent gun laws, and suspend the state sales tax on Aug. 16 and 17.
The liquor license bill would give Boston, which has 692 licenses, 25 additional licenses every year for the next three years. Those would be the first increases since 2006, when the Legislature gave Boston 55 more licenses.
The legislation also marks a shift in power, granting the mayor of Boston control over liquor licenses for the first time since 1906. He would appoint a three-person board to distribute the licenses, replacing the current panel named by the governor.
City officials have long complained that state control over liquor licenses dates to an era when the Yankee-dominated Legislature moved to wrest control of bars and taverns from Irish-Americans who had risen to power in city government.
The legislation was heavily backed by Mayor Martin J. Walsh and others who argued that the cap has hurt economic growth in neighborhoods poised for revitalization, such as Roxbury and Mattapan.
"It's been a hundred-plus years that this law has been on the books, standing in the way of Boston's economic progress," said Councilor Ayanna Pressley, who helped lead the charge on the City Council for local control over liquor licenses.
In a day of intense back-room horse trading and dealmaking, a separate bill to revise the state's approach to substance abuse was one of the last to emerge from final legislative negotiations.
That bill would require coverage for at least 14 days of inpatient detoxification and post-detox care, prohibit insurers from determining whether any addiction treatment — inpatient or outpatient — is medically necessary, and would remove a requirement for a substance user to obtain "prior authorization" from an insurer before entering treatment.
These rules, which would not take effect until late next year, apply to both commercial insurance and managed care plans in the MassHealth program for low-income residents.
"Addiction is a matter of life and death for many," Senate President Therese Murray said Thursday morning, when she announced that lawmakers had reached agreement on a final bill that resolved differences between versions passed earlier by the House and Senate. "The cost of addiction to society is astronomical."
The bill includes other provisions aimed at preventing addiction and tracking the problem, but the insurance restrictions stirred the most debate.
Health insurance companies said the new rules would increase costs and encourage unnecessary inpatient care. They argued that for many patients, outpatient treatment is as effective as inpatient, and the 14-day minimum — while less than the 21 days in the original Senate bill — would fuel the perception that inpatient care is the best option.
Lora Pellegrini, president and chief executive of the Massachusetts Association of Health Plans, said the legislation runs contrary to medical evidence.
"Many national and local experts in substance abuse treatment have raised concerns, and I'm alarmed that their concerns weren't addressed in the final legislation," she said.
Patient advocates said the bill would remove obstacles to treatment that had prevented many from getting care.
"If this was any other disease, we would've addressed this a long time ago," said Representative Elizabeth A. Malia, a Jamaica Plain Democrat. "We don't want to go to any more funerals of our constituents, our friends, and, worst of all, our families."
Senator Jennifer L. Flanagan, a Leominster Democrat who was the bill's chief sponsor, said the legislation did not promote one type of treatment. "It's not our job to tell people how to enter into treatment," she said. "But it's our job to help them enter into the treatment they feel is necessary for them and their families."
Other provisions in the legislation seek to encourage the use of certain kinds of painkillers that are less likely to be used inappropriately by addicts.
Unless directed otherwise by a physician, pharmacists would be required to dispense drugs formulated to prevent abuse, such as those that cannot be crushed for injection or snorting.
Insurers would be barred from charging higher copayments on those drugs.
The bill would require all insurance carriers to reimburse for substance abuse treatment services delivered by a licensed alcohol and drug counselor.
Also approved was a bill to tackle the rising influence of super PACs by requiring them to list their top five donors in their television ads.
That bill also would double how much money individuals can give to state candidates each year from $500 to $1,000 beginning in 2015.
The Legislature sent the governor a measure crafted to increase accountability at local housing authorities. It follows former Chelsea Housing Authority chief Michael E. McLaughlin pleading guilty to filing false reports to conceal his inflated $360,000 annual salary for running the agency. He resigned in 2011 following the disclosure of his salary in the Globe.
The liquor license bill was part of a larger measure aimed at sparking economic growth, which contains a number of tax credits, including one aimed at supporting "the expansion of pre-Broadway and pre-Off Broadway live theater and Broadway tour launches."
Notably, the bill would not make any changes to the state's law on the enforcement of employee noncompete agreements, something Governor Deval Patrick had argued would make Massachusetts more attractive to the technology industry.
The liquor license language was the subject of last-minute wrangling. Initially, lawmakers had restricted all 25 annual licenses to certain underserved neighborhoods such as Roxbury and Mission Hill. Walsh wanted those limits eased, pointing out that other cities have complete control over their licenses.
City officials also pointed out that the recently authorized expansion of the Boston Convention and Exhibition Center in South Boston is expected to include a new hotel. But if all the licenses were granted to outlying neighborhoods, that hotel would not be able to serve alcohol.
In a last-minute change, legislators planned to make five of the 25 licenses issued annually citywide — with no neighborhood restriction.
"The argument was there needed to be flexibility, and how much flexibility was kind of the debate taking place," said Representative Aaron Michlewitz, a North End Democrat.
The Legislature's deadline capped a tumultuous two-year session that saw many lawmakers embroiled in the scandal at the Probation Department.
Lawmakers, none of whom were charged in the case, will now head back to their districts to run for reelection.
When they return in January, it will be a new era at the State House. For the first time in eight years, there will be a new governor, replacing Patrick. Murray will also step down as Senate president that month.
Only House Speaker Robert A. DeLeo will remain among the big three figures on Beacon Hill.
As midnight approached Thursday, lobbyists crowded around the House and Senate doors, making quiet pleas, while legislators hashed out bills in the aisles.
“Nothing like a deadline to keep people moving,” said Representative Nick Collins, a South Boston Democrat. “It’s like when I was preparing for exams: I got more done in the last 48 hours than I did in the last two months.”
Joshua Miller and Felice J. Freyer of the Globe staff and Globe correspondent Yasmeen Abutaleb contributed to this report.