Millions of German workers are winning the fight for a 28-hour work week.

Labor union IG Metall secured an unprecedented deal this week to give a large portion of its 2.3 million members more flexible working hours and a big pay rise.

From next year, workers at many of Germany's top engineering firms -- such as Mercedes-Benz owner Daimler (DDAIF) -- can opt to work 28 hours a week for up to two years, before returning to the standard 35-hour week.

The deal was negotiated with representatives of more than 700 companies in southwest Germany. It is expected to have ripple effects across German industry.

"This sets the standard for everyone else," said Megan Greene, chief economist at Manulife Asset Management.

IG Metall said the flexibility would help employees who want to care for children or relatives. Pay will be reduced to reflect the shorter working week. The deal also gives workers the option to work 40 hours to earn more.

German workers are taking advantage of low unemployment and strong economic growth to flex their muscles.

"You can expect similar deals to come in other sectors and regions soon," said Famke Krumbmüller, a partner at OpenCitiz, a political risk consultancy.

And non-unionized workers could also benefit from the agreement as firms that employ IG Metall workers offer the same terms to their wider workforce.

Related: Ryanair boss to angry pilots: Bring it on!

Daimler said it would offer the new flexible hours to all its employees starting in 2019, but noted it already offered many flexible working options.

Bosch, which employs 138,000 people in Germany, said it would offer the same pay rises and perks to the majority of its German workers. It said the flexible hours wouldn't be disruptive.

"Bosch already has about 100 different working hour models to ensure an optimum work-life balance," said Simon Schmitt, a company spokesperson.

But other companies may find it harder to swallow. Südwestmetall -- the employers' association that agreed the deal -- said it was a compromise with some "painful elements." It would be "hard to bear for many firms," it added.

Südwestmetall spokesperson Volker Steinmaier said the shorter working week could lead to labor shortages. However, most workers are likely to want to work extra hours to make more money, he said.

Related: Mercedes-Benz hits pothole in China with Dalai Lama post

"A couple of companies [already] give their employees a choice to work 30, 35 and 40 [hours]. Most of the employees choose to work longer and earn more," he said.

Germany's surging economy could be the ultimate winner as workers covered by the deal go out and spend more.

IG Metall said its members would get a 4.3% raise, starting in April. That equates to a rise of about 3.5% on average in 2018, according to Florian Hense, an economist at Berenberg bank.

"This is good for workers," said Hense. "They [will] see their pay rise by far more than inflation. This raises their disposable income and spending power."