The bankruptcy of the Hanjin shipping line has thrown ports and retailers around the world into confusion, with giant container ships marooned and merchants worrying whether tons of goods will reach their shelves.

The South Korean giant filed for bankruptcy protection on Wednesday and stopped accepting new cargo. With its assets being frozen, ships from China to Canada found themselves refused permission to offload or take aboard containers because there were no guarantees that tugboat pilots or stevedores would be paid.

"Hanjin called us and said: 'We're going bankrupt and we can't pay any bills — so don't bother asking,' " said J. Kip Louttit, executive director of the Marine Exchange of Southern California, which provides traffic control for the ports of Los Angeles and Long Beach, the nation's busiest port complex.

As of Thursday, three Hanjin container ships, ranging from about 700 feet to 1,100 feet long, were either drifting offshore or were anchored away from terminals. A fourth vessel that was supposed to leave Long Beach on Thursday morning remained anchored inside the breakwater.

That left cargo headed to and from Asia in limbo, much to the distress of merchants looking to stock shelves with fall fashions or Christmas toys. "Someone from the garment industry called earlier today asking: 'How long is this going to go on, because I've got clothing out there,' " Louttit said.

There were reports that some Hanjin ships had been seized in China on behalf of creditors.

The National Retail Federation, the world's largest retail trade association, wrote to U.S. Secretary of Commerce Penny Pritzker and Federal Maritime Commission Chairman Mario Cordero on Thursday, urging them to work with the South Korean government, ports and others to prevent disruption.

Hanjin, the world's seventh-largest container shipper, represents nearly 8 percent of the trans-Pacific trade volume for the U.S. market and the bankruptcy is having "a ripple effect throughout the global supply chain" that could cause significant harm to both consumers and the U.S. economy, the association wrote.

"Retailers' main concern is that there (are) millions of dollars' worth of merchandise that needs to be on store shelves that could be impacted by this," said Jonathan Gold, the group's vice president for supply chain and customs policy. "Some of it is sitting in Asia waiting to be loaded on ships, some is already aboard ships out on the ocean and some is sitting on U.S. docks waiting to be picked up. It is understandable that port terminal operators, railroads, trucking companies and others don't want to do work for Hanjin if they are concerned they won't get paid."

The confusion might sink some trucking firms that contract with Hanjin to deliver cargo containers carrying everything from electronics to car parts from ports to company loading bays.

"They've got bills to pay — they could literally close their doors over this," said Peter Schneider, Fresno-based vice president of T.G.S. Transportation Inc.

Hanjin has been losing money for years. It filed for bankruptcy protection a day after its creditors, led by a state-run bank, refused to prop it up.

Other shipping lines were moving to take over some of the Hanjin traffic but at a price. Their vessels already are operating at high capacity because of the season and shippers may wind up paying a premium to squeeze their cargo containers on board, said Jock O'Connell, international trade adviser to Los Angeles-based Beacon Economics.

The price of shipping a 40-foot container from China to the U.S. jumped up to 50 percent in a single day, said Nerijus Poskus, director of pricing and procurement for Flexport, a licensed freight forwarder and customs broker based in San Francisco.

The price from China to West Coast ports rose from $1,100 per container to as much as $1,700 on Thursday, while the cost from China to the East Coast jumped from $1,700 to $2,400, he said.

Hanjin's bankruptcy was a major factor, he said, although prices also were affected by the upcoming Chinese National day holiday, which will close factories, and by shipping lines sidelining vessels to reduce overcapacity.

A weakened economy since the 2008 recession hurt global demand and trade at the same time that steamship lines continued to build more and larger vessels — immense ships that were conceived as cost-effective when freight costs were higher several years ago.

But the weaker trade and overcapacity has sent ocean shipping rates plunging in recent years. A few months ago, Poskus said, prices hit historic lows globally — down to as much as $600 per container from Shanghai to Los Angeles.

That wouldn't even cover fuel costs for the huge ships, he said.

Poskus predicted that the current price hikes will be temporary, perhaps only lasting a month or two. With about 5 percent of ships in the global trading fleet sitting idle, there is plenty of room to take over Hanjin's capacity and carriers already are discussing the possibility of adding ships, he said.

However, prices will have to rise somewhat in order to be sustainable, he said — perhaps to about $1,000 per container.