MELROSE — Hallmark Health officials who run Melrose-Wakefield Hospital are staying the course as they seek a company merger with Partners HealthCare.

Partners announced Tuesday it would not pursue a plan to acquire Weymouth’s South Shore Hospital but would remain steadfast in its intention to merge with Hallmark Health, which also operates Lawrence Memorial in Medford.

Partners filed a notice in Suffolk Superior Court on Tuesday saying it won’t proceed with the acquisition.

The filing comes just weeks after a Suffolk Superior Court judge rejected an agreement that Partners worked out with former Attorney General Martha Coakley to allow the merger.

Coakley’s successor, Attorney General Maura Healey, had said she would try to block any future merger after the court rejected the deal.

As part of Tuesday’s filing, Healey has agreed to further evaluate Partners’ proposed acquisition of Hallmark Health Systems if that deal moves forward.

South Shore Health President Richard Aubut said the prospect of “costly and prolonged litigation” to pursue the merger wasn’t in the hospital’s interest.

A Hallmark spokesman, when asked for a comment, said, “Hallmark Health System remains committed to working with Partners HealthCare and the Commonwealth of Massachusetts to manage the growing costs of health care.

“Our communities have expressed strong support for this affiliation which would enhance options for high quality, lower cost care in north suburban Boston.”

Within the last couple of months, Hallmark has publicized its plans to improve the Melrose-Wakefield Hospital campus. The changes likely would take place over four distinct phases, representatives said, culminating in the creation of a new patient care wing to “better accommodate and care for patients requiring critical care, maternal and infant care and emergency care.”

Other aspects of the proposed plans at Melrose-Wakefield Hospital are designed, representatives have said, to “improve patient access to facilities, provide services for the growing population of patients in Melrose, alleviate neighborhood on-street parking and congestion and update existing patient care space to better meet the needs of patients in today’s changing health care environment.”

The work will be done within Melrose-Wakefield’s current footprint.

On Jan. 29, Suffolk Superior Court Judge Janet Sanders rejected an agreement that Partners had with Coakley, specifically the merger with South Shore Hospital. The Hallmark merger was part of the overall agreement, however.

In the wake of that decision, a Hallmark spokesperson said the Melrose-Wakefield Hospital expansion would go ahead as planned.

“Our plans remain the same. However, this decision could affect the overall timing of this multi-year project.”

— Material from the Associated Press was used in this report.