Three days before the bankrupt Steward Health Care is set to shutter its hospitals in Dorchester and Ayer, ralliers gathered outside the State House to make a last-minute appeal for top government officials to step in.

Nurses, elected leaders and other community members who spoke at the rally called on Gov. Maura Healey and top lawmakers to take any steps necessary to intervene in the planned closures of Carney Hospital and Nashoba Valley Medical Center, the two facilities that Steward has said did not attract bids from qualified buyers during the bankruptcy process.

“We are here today to state in no uncertain terms that there was no moral or medical justification for this closure,” Massachusetts Nurses Association President Katie Murphy said. “We are here to make clear to the public that the only viable contingency plan to protect the public regarding the closure of the Valley Medical Center and Carney hospitals is to not close the hospitals.”

Speakers urged the Healey administration and other state officials to declare a public health emergency to keep the two hospitals open, enforce a state law that requires a 120-day notice period before a hospital closes, and tap into the state’s roughly $8 billion “rainy day” reserve account for funds to facilitate a transfer to new owners.

The crowd chanted phrases including “knock, knock, Maura, we’re at your door,” “health care is a human right” and “keep Nashoba care in Ayer.”

New owners have been identified for Steward’s other Massachusetts hospitals, though the bankruptcy court hearing where those sales could be approved has been repeatedly delayed. The details of the deals — and how much money state government will put up to help finance them — are not yet clear.

Healey is pursuing an eminent domain process in hopes of seizing the property housing St. Elizabeth’s in Brighton, with the plan to have Boston Medical Center step in as its new operator.

“The Healey-Driscoll administration shares the frustration of communities and staff regarding Steward’s planned closures of Carney and Nashoba Valley Hospitals,” a spokesperson for Healey’s Executive Office of Health and Human Services said in a statement. “Unfortunately, these hospitals did not receive qualified bids to continue operating. We have been working with other hospitals and health centers in these regions to preserve access to essential medical services and help patients transition their care. We also have teams on the ground helping staff find new employment opportunities.”

Boston City Councilor John FitzGerald said during the rally that the Carney community is asking “for a fair chance from the governor, from the state, that every other hospital in Steward has gotten that chance except for us and Nashoba.”

“The fight’s not over,” he said. “The 31st is approaching fast and it means that the doors may shut for a time, but we’re not gonna keep them shut forever. We’re going to get it back open.”

The Beacon Hill rally comes after the state’s Department of Public Health last week determined that both Carney and Nashoba offer “essential services” for the health of their regions. The designation doesn’t mandate that the hospitals stay open, but it allows the DPH to require that Steward submit plans for ensuring access to care after the hospitals close.

On Tuesday, an independent ombudsman monitoring the quality of care for Steward’s patients warned that closing Nashoba would have a “devastating impact” on its patients, many of whom are elderly, low-income or lack access to transportation.

The ombudsman, health care management consultant Suzanne Koenig, asked that the hospital’s emergency department stay open for another 30 days, or at least that an ambulance be stationed outside for a week so paramedics could try to stabilize and transport anyone who showed up seeking care.

Nashoba nurse Michelle Travers said a Pepperell or Townsend resident could spend an hour trying to get to other hospitals in Leominster or Concord during traffic-heavy times of day.

“This will cost the difference between life and death for emergencies such as a stroke, a heart attack [or] an anaphylactic reaction,” Travers said. “If this hospital is allowed to close, there will come a day when you or your loved one will desperately need an ambulance, and you will remember these words.”