MINNEAPOLIS — Nurses at five Allina Health hospitals in Minnesota have voted to approve a labor contract, ending a strike that has dragged on for more than a month.

A majority of rank-and-file members of the Minnesota Nurses Association ratified the agreement Thursday, just days after Gov. Mark Dayton intervened and called both sides back to the bargaining table.

The union and Allina Health said the nurses in the Twin Cities area will head back to work Sunday. About 4,000 nurses had been on strike since Labor Day. A weeklong strike was also held in June. Health insurance benefits were a major issue during nine months of labor negotiations.

Union Executive Director Rose Roach said the agreement, reached earlier in the week, improves workplace safety issues, staffing policies and ensures health benefits won’t be reduced.

“While it’s certainly nowhere near what the nurses deserve, nurses can hold their head high,” she said. “They can rest easy knowing that they won a no-diminishment clause that ensures that the value of their health benefits won’t be reduced in some future cost-cutting scheme.”

Under the contract, nurses agreed to move off their union-only health plans and onto a less expensive corporate insurance plan. But the company guaranteed the value of the union plan won’t change through 2021, and it agreed to put up to $2,500 in nurses’ health reimbursement or health savings plans if they make the switch to the corporate plan in the next five years.

Dayton and Lt. Gov. Tina Smith said in a joint statement that they are “grateful this long and painful strike has ended.”

Allina said in a brief statement that it appreciated the nurses’ ratification of the agreement.

The affected hospitals were United Hospital in St. Paul, Mercy Hospital in Coon Rapids, Unity Hospital in Fridley and Abbott Northwestern and the Phillips Eye Institute in Minneapolis.