Matson Inc., reached an agreement with two key unions Friday, avoiding a strike that posed a threat to Hawaii’s supply of everything from food to building materials.

“Matson is pleased to have reached a fair and equitable agreement, and that’s all that there is for now,” said Keoni Wagner, a spokesman for the Honolulu-based shipping giant.

The Sailors Union of the Pacific and Pacific Coast Marine Firemen, Oilers, Watertenders and Wipers Association were threatening a strike if the parties could not reach an agreement by 9 p.m.

Cory Lum/Civil Beat

The four-year agreement still must be ratified by union members, said Gunnar Lundeberg, president of the sailors union. He said a ratification vote will take place starting with meetings with members based in San Francisco on July 10 and moving to Honolulu the next week.

“We squeezed Matson, and they did the right thing,” Lundeberg said.

The union represents sailors who work in the deck, engine and steward’s departments of vessels under contract with the organization.

With the flow of necessities into the state at risk, the parties were in San Francisco working into the night to craft a contract.

Earlier Friday, union representatives had downplayed the threat of a strike, but said it was possible. Stuart Melendy, Honolulu port agent for the firemen’s association, did not respond to calls for comment after Matson announced the tentative deal.

Lundeberg estimated Matson’s container ships bring in 70 to 80 percent of the goods imported into Hawaii, transporting everything from building materials fueling Honolulu’s development boom to frozen French fries to home essentials.

“Toilet paper’s a popular item,” he said.

According to Wagner, the unions represent about 135 workers, which is a fraction of the 712 employees covered by collective bargaining agreements. But the threat of a strike created risk of a work stoppage by the other unions, which would have shut down operations of Hawaii’s largest shipping company.

The company reported net income of $80.5 million on $1.9 billion of revenue in 2016. Matson has 1,925 regular employees and operations in Hawaii, Alaska, Guam, Micronesia, as well as China and the West Coast of the continental U.S.