A Suffolk Superior Court judge has denied a deal that would have allowed Partners HealthCare to acquire three community hospitals.

The Thursday decision issued by Judge Janet L. Sanders, according to The Boston Globe, put an end to a nearly three-year-long process, which started when Partners set its sights on South Shore Hospital. Melrose-Wakefield and Lawrence Memorial hospitals were the other two hospitals included in the deal.

Partners had argued that acquiring the three hospitals would allow it to offer cheaper, more coordinated care across an expanded network.

The Globe notes former Massachusetts Attorney General Martha Coakley brokered the deal, following a multi-year investigation and months of negotiations. The state’s new Attorney General, Maura Healey, was opposed the deal.

Partners is still allowed to pursue the acquisitions, but would risk potential litigation, the Globe reports.

Had deal gone through, Partners would have been forced to cap its prices and change its contracting practices, the Globe reports.

Photo via Partners HealthCare