Attorney General Maura Healey has signed off on a 13-hospital merger involving Beth Israel Deaconess Medical Center and Lahey Health, which would create the state's second-largest hospital system.

Healey signed off on the merger after negotiating a number of conditions the new hospital network would have to meet, including price caps for several years and a prohibition on turning away new MassHealth patients.

John Kingsdale, a healthcare policy expert and associate professor at Boston University's School of Public Health, said whatever concessions Healey won, bigger hospitals still have more leverage to raise prices.

“The context here is that we still have very high health care costs here in Massachusetts — the highest in the country — and we need as a society to draw the line and stop these kinds of mergers, eventually," Kingsdale said.

Amy Rosenthal, the executive director of Health Care for All, a Boston-based nonprofit patient advocacy group, said Healey's agreement with the hospitals is good news.

"Some of the things that were in the settlement that we were really pleased to see, some of them relate to MassHealth," Rosenthal said. "Certainly the requirement to not cap the number of MassHealth patients ... These are things that we requested and asked for, and we were really pleased to see in the settlement."