A German court has blocked a planned strike by rail workers on Thursday, citing the disruption it would have caused to holidaymakers.
A strike could cost millions, business groups have warned
The GDL union, which represents drivers at state firm Deutsche Bahn, said it would appeal against the injunction but would not take part in illegal action.
GDL is seeking a 31% pay rise for its members, although the firm has agreed a 4.5% rise with other unions.
Strike action could threaten plans to part-privatise Deutsche Bahn next year.
Unions have expressed concerns at the plan, approved by ministers last month, to sell off a stake of up to 25% to private investors.
Drivers had been planning a four-hour stoppage on freight services, in what would have been the first nationwide rail strike since 1992.
It was feared the disruption could spread to passenger services at the height of the holiday season, leading business groups to say it would cause "immense" damage to the economy.
A spokesman for the labour court in Nuremberg said it had taken into account the likely economic consequences when deciding to grant Deutsche Bahn's injunction request.
"Naturally we will now appeal," said Manfred Schell, head of the GDL union - which has about 12,000 members at the company.
GDL rejected the 4.5% pay rise agreed between the company and two unions representing other rail workers.
GDL says its members should benefit more from the recovery of the German economy, which has led to an increase in freight and passenger traffic.
Deutsche Bahn, which carries more than five million passengers a day, said it hoped to restart negotiations as early as Thursday.
"We remain open to compromise," said a company spokeswoman.
The long-delayed plans to part-privatise the firm were finally approved last month, although details of the scheme have yet to be finalised.
The plan, designed to free up cash to invest in rail infrastructure, would see the company retain control of the network.