The state of Alaska and its largest ferry workers union have reached a tentative agreement in contract negotiations, both parties said Friday.

Those negotiations have been ongoing for years and last week escalated into the first strike by ferry workers of the Inlandboatmen’s Union of the Pacific since 1977.

The tentative deal reached late Thursday night is for a new three-year contract, the Alaska Department of Administration said in a written statement. The deal still needed to be approved by union members as of Friday afternoon.

State ferries that sail the Alaska Marine Highway System, which serves more than 30 coastal communities, will not be able resume service immediately, the state said. Sailings are set to start again on Sunday, according to a schedule posted on the state’s website Friday afternoon. (Alaska Department of Transportation Commissioner John MacKinnon previously had told reporters that the earliest sailings might resume was Saturday.)

Terms of the tentative agreement will be released once the contract is ratified by IBU members, the state said.

“We spent a lot of long hours and late nights at the negotiating table, but it was worth it,” Department of Administration Commissioner Kelly Tshibaka said in the written statement. “I want Alaskans to know both the IBU and the State made concessions and compromises to reach this win-win agreement.”

IBU board vice chair Robb Arnold would not share specifics of the agreement. Technically, he said, the strike is still on until members approve the tentative deal.

“We took our pickets down, but we’re still technically on strike,” Arnold said. “We’d like to get back to work as soon as possible.”

Contract negotiations between the IBU and the state have been going on since 2017, when the union’s last three-year contract was up. On Wednesday last week, the strike began. State ferries stopped sailing, leaving many people in communities that rely on those vessels to get around either stuck or scrambling for alternate modes of transportation during the busy summer season. Many of those communities do not have road access.

In the island town of Kodiak, people were stranded with their motor homes. The stoppage stymied plans for some who were trying to get to and from Haines via ferry for the annual Southeast Alaska State Fair. Southeast companies Harris Aircraft Services and Allen Marine upped their services to get more people where they needed to go.

Representatives with the Department of Administration and with the IBU met last weekend with a federal mediator in an effort to make progress on the deadlock. The mediator flew up to Juneau from Seattle, left after about 20 hours of talks and then came back Tuesday night.

The tentative agreement came together around 11 p.m. Thursday, said Beth Schindler, regional director for the Federal Mediation and Conciliation Service.

“It was clear, coming in and meeting with everyone, that both sides really wanted to find a way to reach an agreement that could be supported by both the state and the union,” Schindler said in a phone interview Friday on her way to catch a flight back to Seattle. “Both sides were very relentless in working toward making that happen.”

The state has said that the union’s strike is illegal because of a provision that was included in the union’s demands. While IBU said its demands weren’t in violation, it changed its proposal, but the state said it still saw the stoppage as unlawful.

In a cease and desist letter dated last Friday and addressed to Tshibaka, an attorney representing IBU pushed back and said those claims were false and “amount to unlawful threats."

Alaska’s ferry system has 11 ships, with nine in service: Aurora, Columbia, Kennicott, LeConte, Lituya, Malaspina, Matanuska, Tazlina, and Tustumena. Some of the smaller vessels are easier to get back into service than others, MacKinnon said.

The ferry schedule posted on the state’s website Friday afternoon takes into consideration where each ship is docked, where each will depart to, and allows for time to get the vessels prepared to sail.

“I hope everyone understands we can’t just flip a switch and get the ships running,” he said.

The Columbia and the Kennicott saw some of the greatest levels of disruption, MacKinnon said. They are the larger vessels in the fleet and had been en route to Bellingham, Washington, he said.

“They ended up in Ketchikan full of passengers and full of vehicles,” he said. “It was hard to get them out of Ketchikan.”

The state had refunded more than $3 million in fares for 8,151 passenger cancellations and 2,329 vehicle cancellations as of Thursday afternoon, Alaska Department of Transportation spokeswoman Shannon McCarthy said in an email.