Having averted what would have been the largest nurses strike in Massachusetts history and the first nurses strike in Boston in more than 20 years, Boston Mayor Martin Walsh met Monday with officials from Brigham and Women's Hospital.

Related: Brigham and Women's Hospital nurses vote to walk out

About 3,300 Brigham nurses represented by the Massachusetts Nurses Association had authorized a one-day strike to be held Monday, but weekend negotiations led to a temporary agreement the union said "protects safe patient care, enhances hospital security, successfully fights off attempts to implement non-union benefits for new nurses and includes a fair wage increase."

"This is a huge victory for Brigham patients and the practice of nursing," Trish Powers, an operating room staff nurse and chair of the MNA bargaining unit, said in a statement. "Brigham nurses stood together and were ready to hold an historic one-day strike for their patients, for our community and for the Brigham Way of excellent and safe patient care."

The hospital said the tentative agreement struck after 10 months and 23 negotiating sessions "allows the hospital to remain within the financial objectives it had established." The hospital administration said the mayor's involvement in talks with the union was crucial to avoiding a strike.

"We are most grateful for the support of the many elected officials and community leaders who provided guidance," Dr. Betsy Nabel, president of Brigham and Women’s Health Care, said in a statement. "This agreement would not have been reached without the tremendous commitment of Boston Mayor Marty Walsh, and our entire Brigham family is grateful for his intervention."

The contract, which still needs to be ratified by the full union membership, would provide for a restoration of December 2015-level nurse staffing, a series of new security measures and 2 percent across-the-board wage increases for every MNA nurse at the Brigham over three years, according to the union.

Walsh spoke with hospital administrators at noon in the hospital's Stoneman Centennial Park on Francis Street in Boston.