Unionized dockworkers and their employers reached a deal Friday to avert a strike at East and Gulf Coast ports that business and agriculture groups say could have cost the economy billions of dollars.

The International Longshoremen’s Association (ILA) and the U.S. Maritime Alliance struck a deal in principle, subject to sealing a new collective bargaining agreement.

The arrangement will keep 14 East and Gulf Coast ports from Houston to Boston operating, avoiding a shutdown that business and agriculture groups feared would harm the economic recovery.

Those groups had urged President Obama to invoke the Taft-Hartley Act to break the strike, should it occur. Whether Obama would have tried to buck a union base that supported his reelection campaign was unclear.