Teachers in St. Paul, Minnesota ended a days long strike on Friday, just in time for schools to shut down for the coronavirus.

Officials with the St. Paul Federation of Educators ordered the strike last Tuesday in an alleged effort to force the district to employ more mental health experts, counselors and other staff. On Friday, amid a national wave of school closings tied to the coronavirus, the district and union agreed on a new contract that includes $4.7 million more for mental health staff and about twice that amount in pay increases, the Pioneer Press reports.

MORE NEWS: Know These Before Moving From Cyprus To The UK

“Our strike was very successful,” SPFE negotiator Pete Grebner said in a video. “It wasn’t until the World Health Organization declared a pandemic because of the coronavirus that we had to change our plans. Unfortunately, we had to settle for a few things we wouldn’t have settled for.”

The deal includes $9.6 million in wage increases along with automatic step increases for education and seniority. The $4.7 million to hire additional counselors, psychologists, nurses, social workers and behavior intervention specialists is about 15 percent of the union’s initial demand, according to the news site.

“We did have to settle for the district’s wage increase proposal, but none of the staffing increases were costed against that wage increase,” Grebner said in the video.

More than 36,000 students in St. Paul have been out of school since last Tuesday. Teachers reportedly returned Friday afternoon and are working on distance learning plans on Monday.

Gov. Tim Walz ordered the state’s schools to close for eight days starting Wednesday, though several districts including St. Paul closed on Monday instead. The governor’s order requires teachers and administrators to continue working to develop distance learning plans in the event schools must remain closed beyond March 27, the Minneapolis Star-Tribune reports.

“We cannot wait until the pandemic is in our schools to figure things out,” Walz said at a press conference with Education Commissioner Mary Cathryn Ricker.

MORE NEWS: How to prepare for face-to-face classes

Officials delayed school closings until Wednesday to allow students to return to school for personal items, medications and other necessitates, they said.

“We are not accommodating for a couple snow days, we are planning for the potential for weeks of distance learning,” Ricker said.

Walz’s executive order tasks schools with remaining open to provide child care for first responders and health professionals and other critical professions during regular school days. It also requires schools to continue to pay staff and to continue to provide meals and mental health services for students, KARE reports.

“The safety and well-being of our students is always our top priority,” Ricker said.  “That is why we are committed to creating an education delivery model that can sustain learning, no matter the circumstances. Minnesota has long valued education and we will continue to work with our school leaders to ensure that our students continue to receive the education they need and deserve. Educators are caring, creative people and I am confident they are going to work to meet the needs of our students in these extraordinary times.”