The Massachusetts Nurses Association and Tufts Medical Center reached a tentative contract agreement Monday, five months after a contentious strike and a four-day lockout by management.

It's been a long road that often included bitter talks at the bargaining table for negotiators of the 1,200-member Massachusetts Nurses Association and Tufts Medical Center.

After 20 months of negotiations and nearly 50 bargaining sessions, and with the help of Mayor Marty Walsh, whose office served as a backdrop, union members hashed out a tentative contract with the hospital inside City Hall late yesterday.

Registered nurse and union bargaining co-chair, Mary Havlicek Cornacchia, says it was a relief to finally reach a contract agreement. 

“Mayor Walsh called both parties late Friday and invited us to his arena, hoping a different venue might help us breathe a little fresh life into our talks, and it appeared to work," she said.

Walsh is a former union head. Havelicek Cornacchia says Walsh's role was small, but helpful. “He definitely had a little something to do with pushing us along … and brought both parties together.”

The tentative contract extends three years and nine months. It gives nurses a 6 percent pay raise over the term of the contract, staffing level protections, and includes a revised pension agreement. That moves nurses to a defined contribution plan similar to a 401k.

Nurses are scheduled to take a ratification vote on Jan. 3.