Allina Health and its nurses reached a tentative agreement around 4 a.m. Tuesday after a 17-hour negotiating session called together by Gov. Mark Dayton at his residence.

Terms of the deal weren’t immediately available, but a statement released by Dayton’s office thanked the two sides “for working to reach this tentative agreement, which will allow them to resume the quality health care that Minnesotans need and deserve.”

More than 4,000 nurses from five Allina hospitals will now vote whether to accept the contract. Nurses have rejected three prior contracts, most recently in an Oct. 3 vote. But this time their union, the Minnesota Nurses Association, will recommend the contract’s approval, according to the statement from the governor’s office.

Allina and its nurses have had more than 20 negotiating sessions since February that have focused largely on health insurance. Nurses rejected contract offers that would phase out their popular union health insurance plans. The first of those three rejection votes prompted a seven-day strike in June and the second prompted the open-ended strike that started Labor Day, 36 days ago.

Together, the two strikes are longer than the 38-day strike in 1984 that also involved Allina and its nurses, but over seniority rules.

Monday’s meeting put the two sides face to face for the first time in a while. Recent negotiations have mostly involved a federal mediator acting as a go-between. During a three-day session last month, negotiators for Allina and the Minnesota Nurses Association never spoke to each other in person, a union official said.

Dayton had been in contact with both sides in recent weeks, but called the Monday meeting after the contract vote by nurses on Oct. 3.

Both sides accepted the governor’s invitation. Allina’s chief executive, Dr. Penny Wheeler, attended in addition to the health system’s negotiating team.

The two sides came closer to compromise in September. Allina agreed to 24-hour security staffing in its emergency departments — a key issue for nurses in an era of increasing hospital violence — and to a joint committee that would address staffing issues such as charge nurses taking patients and having too little time to properly supervise and assist front-line nurses.

The nurses meanwhile agreed to phase out the four union health plans, which Allina argued were too expensive and unsustainable, and move to Allina’s company plans. But the union wanted some administrative control over Allina’s plans to make sure cost and quality levels were maintained, and Allina didn’t agree to that.

Allina’s prior offer would have retained two of the union’s health plans until 2020, but would have given nurses financial incentives to switch to its plans before then. In lieu of giving the union oversight, the contract offered a guarantee that the actuarial value of Allina’s most popular health plan would never change by more than 7 percent in any three-year period.

Nurses on Oct. 3 rejected that offer by what MNA executive director Rose Roach described as a “resounding” margin.

Pickets continued Monday outside five Allina hospitals: United in St. Paul, Mercy in Coon Rapids, Unity in Fridley, and Abbott Northwestern and the Phillips Eye Institute in Minneapolis.

Both sides have felt the sting of the protracted dispute.

While Allina anticipates $10 million per year in savings by phasing out the union health plans, it spent $20 million on temporary staffing to keep its hospitals open during the one-week strike in June. The costs of the current strike haven’t been reported yet, but have easily doubled the costs from the June strike.

The union also reported last week that 200 nurses have left the Allina system since June. Pickets outside Unity displayed empty scrubs on Friday to represent the nurses that Allina has lost.

Allina, meanwhile, has reported that more than 630 nurses have returned to work at their hospitals amid the strike. How many of those nurses simultaneously resigned from the union is unclear.