NEW YORK (AP) — Nurses and two major hospital systems in New York City have reached a deal to end a nearly monthlong strike over staffing levels, workplace safety, health insurance and other issues.

The tentative agreement announced Monday by the nurses’ union involves the Montefiore and Mount Sinai hospital systems. Nurses remain on strike at NewYork Presbyterian.

The walkout began Jan. 12, prompting the hospitals to scramble to hire legions of temporary nurses to fill in during a demanding flu season. The three-year deal affects roughly 10,500 of the some 15,000 nurses on strike at some of the city’s biggest private, nonprofit hospitals.

“For four weeks, nearly 15,000 NYSNA members held the line in the cold and in the snow for safe patient care,” Nancy Hagans, president of the New York State Nurses Association, said in a statement. “Now, nurses at Montefiore and Mount Sinai systems are heading back to the bedside with our heads held high.”

The nurses union said the tentative agreement calls for a 12% pay raise over the life of the contract, as well as maintains nurses’ health benefits with no additional out-of-pocket costs. Additionally, the proposed pact includes new protections against workplace violence, including specific protections for transgender and immigrant nurses and patients, as well as provisions addressing artificial intelligence in hospitals, the union said.

Nurses at Montefiore and Mount Sinai hospitals will vote to ratify their contracts starting Monday. If the tentative contract agreements are ratified, nurses will return to work on Saturday. Mount Sinai said it would comment later on the deal while a Montefiore spokesperson confirmed its nurses will be voting Monday through Wednesday but declined to comment further.

Meanwhile, NewYork-Presbyterian said it agreed over the weekend to a proposal that includes pay raises, preserves nurses’ pensions, maintains their health benefits and increases staffing levels. The union reiterated that the strike remains in effect at NewYork-Presbyterian hospitals.

The affected hospitals insisted their operations are running smoothly during the walkout, with organ transplants, cardiac surgeries and other complex procedures largely uninterrupted. Many medical centers, however, canceled scheduled surgeries, transferred some patients and discharged others ahead of the strike.

Striking nurses voiced concerns over being overworked and the lack of manageable patient loads. The union highlighted that these tentative agreements intend to improve staffing and address these pressing concerns.

The negotiations revealed specific demands the union put forward, including workplace security upgrades and restrictions on artificial intelligence applications. Heightened security concerns often stemmed from incidents, including a recent gunman entering Mount Sinai in November and other security breaches in local hospitals.

The hospitals contended that union demands were excessive. They cited that unionized nurses’ salaries already average between $162,000 to $165,000 annually, not including benefits.

Nurses and their allies, including New York City Mayor Zohran Mamdani and independent U.S. Senator Bernie Sanders, countered that top hospital executives earn considerable salaries. Not all hospitals faced strikes, and other private facilities managed to negotiate agreements before the strike escalated.