Germany's main train drivers union has ended a bitter labor dispute with the country's biggest railway operator that saw nine strikes over the past year.

The GDL union, which mostly represents train drivers but also some other railway staff, reached a deal with state-owned Deutsche Bahn that will prevent further transport chaos for Europe's biggest economy.

Bodo Ramelow, a left-wing state governor brought in to help resolve the dispute, said Wednesday that the agreement would help ease the workload on train drivers by reducing overtime and setting a 38-hour work week.

The deal also sees a two-stage pay increase of more than 5 percent in the coming years, one of the key demands made by GDL.