HERZOGENAURACH, GERMANY — Shares of German sportswear firm Adidas (ADDYY.PK) soared on Wednesday after it announced a large buyback, gave an upbeat outlook for 2018 and lifted its 2020 profitability forecast, helped by rapid growth of e-commerce.

Adidas, which has seen its shares fall 15 per cent in the past six months as sales growth cooled, said late on Tuesday it plans to buy back up to three billion euros (US$3.7 billion) worth of its shares by 2021, or almost nine per cent of its share capital.

The company's shares were up 8.7 per cent at 5:10 a.m. ET, the biggest gainer on the German blue-chip index.

"Adidas is transforming from a top-line [revenue] story to a margins story," said Morgan Stanley analysts, who rate the stock "equal-weight".

"While the slowdown in organic growth is going to raise some questions today, confidence on the profitability progression implies a continued superior growth potential."

After a tough few years, Adidas has returned to form under Chief Executive Kasper Rorsted, taking market share from bigger rival Nike in North America and selling its underperforming TaylorMade golf and CCM Hockey brands.

Since taking over in 2016, Rorsted has put a bigger focus on improving profitability, which still lags Nike (NKE.N).

Adidas and Nike have both been benefitting from a big rise in sales of shoes online, which boosts profitability. Adidas said ecommerce sales rose 57 per cent in 2017.

Adidas forecast currency-neutral sales would rise around 10 per cent in 2018, with an operating margin of between 10.3 and 10.5 per cent, up from 9.8 per cent in 2017. Nike reported an operating margin of 13.8 per cent for its 2016/17 fiscal year.

Adidas lifted its forecast for the operating margin to hit 11.5 per cent by 2020, up from a previous target for 11 per cent.

Adidas said fourth-quarter sales rose 12 per cent to 5.06 billion euros, a currency-neutral rise of 19 per cent, but missing analyst forecasts for 5.13 billion as sales in Russia and at its Reebok brand slipped.

Fourth-quarter operating profit more than tripled to 132 million euros, beating analyst forecasts for 61 million, but the company recorded a net loss of 41 million euros after a tax impact of 76 million due to changes in the U.S. tax code.

The buyback comes on top of a proposed dividend of 2.60 euros per share, above average analyst forecasts for 2.53 euros.