SEATTLE — A federal judge on Wednesday ordered striking airline cargo pilots who transport packages for Amazon and other customers to immediately resume work.

About 250 pilots for the carrier, ABX Air, went on strike on Tuesday, accusing their employer of forcing them to work an excessive number of flight assignments in violation of their contract. The strike threatened to hold up shipments of Amazon orders, though the internet retailer said it had avoided delays so far.

In a hearing Wednesday evening in Cincinnati, Federal District Court Judge Timothy S. Black granted ABX Air a temporary restraining order blocking the strike, according to representatives of the company and pilots’ union.

The Airline Professionals Association, Teamsters Local 1224, the union representing the pilots, started the strike because of what it called significant understaffing problems at ABX Air, which has demanded that pilots fly “emergency” flights to meet the demands of its cargo customers, disrupting the pilots’ schedules.