* To pay dividend of 0.57 euro per share for 2017
* Analysts had expected no dividend until 2018
* Company forecasts rise in operating profit in 2018
* Shares up 2.3 percent (Recasts, adds CEO comment, details)
FRANKFURT, March 28 (Reuters) - Container shipping line Hapag-Lloyd announced a surprise dividend to shareholders on Wednesday and forecast a rise in annual earnings this year thanks to synergies from its merger with Gulf peer UASC.
Hapag-Lloyd merged with UASC last year, becoming the world's No. 5 container shipper after overcapacity, price wars and freight rates far below break-even levels fanned industry consolidation.
The German group said it would pay its shareholders 0.57 euro per share for 2017 - its first dividend since its stock market listing in November 2015 - after its operating profit nearly doubled to 1.06 billion euros ($1.3 billion) in 2017, even as freight rates remain flat due to the merger with UASC.
Analysts had not expected a payout until next year.
Hapag-Lloyd forecast a rise in its operating profit (EBITDA) this year but did not say by how much.
"The market environment remains challenging, but as we see some of the fundamentals improving gradually over the upcoming period, we remain cautiously optimistic," Chief Executive Rolf Habben Jansen said.
Shares in Hapag-Lloyd rose 2.3 percent to 30.74 euros by 1204 GMT.
($1 = 0.8064 euros) (Reporting by Maria Sheahan and Vera Eckert; Editing by Christoph Steitz and Susan Fenton)