Germany's second-largest bank, still partly owned by the German government, is overhauling its business by reducing staff, digitising its back office and expanding its retail customer base.

It reported a net profit of 272 million euros (£242.8 million) for April-June, beating a Reuters poll forecast of 227 million euros and reversing a 640 million euro loss a year ago when it was hit by restructuring costs.

While those costs are not as heavy this year, the bank lifted its estimate for operating costs for the full year, to around 7.1 billion euros ($8.2 billion) from a previous 7.0 billion, citing continued investment in technology.

Revenues from its corporate clients would be lower in 2018 than last year amid what the bank called "intense competition".

Commerzbank's shares were trading down 1.8 percent at 0825 GMT, after falling more than 3 percent in early trade.

"Our growth initiatives are already working," Chief Executive Martin Zielke said in a statement. "Of course, it will take some time for them to take full effect."

The restructuring programme, announced in 2016, is due to be completed in 2020.

The bank said that it was on target to pay a dividend for 2018 of 20 cents per share, its first dividend since 2015.

(Reporting by Tom Sims; Editing by Maria Sheahan and Susan Fenton)

By Tom Sims