Germany's largest lender Deutsche Bank raised its 2022 revenue target Wednesday after posting a better-than-expected net profit for the second quarter, even as it took a hit from an unfavourable court ruling on banking fees.

Net profit for the April-June period reached 692 million euros ($817 million), compared with a 77 million euro loss a year earlier.

Analysts surveyed by Factset had forecast a smaller net profit of just under 430 million euros.

Group revenues fell one percent to 6.2 billion euros, weighed down by an 11-percent drop in revenues at Deutsche's investment banking division -- the one-time problem child that has been a recent growth driver.

Deutsche pointed out however that after an exceptionally strong performance in the first quarter, the investment unit's revenues over the six months of 2021 were still up nine percent on the year.

Deutsche's retail banking unit meanwhile suffered a setback from a ruling in April by the German Federal Court of Justice (BGH), which found that banks did not have the right to introduce checking account fees by assuming silent consent from customers.

The verdict has far-reaching consequences for Germany, where millions of bank customers can now claw back the fees.

Deutsche said it had lost 93 million euros in foregone revenues as a result of the ruling, and another 130 million in litigation costs.

But the lender was boosted by lower provisions for credit losses, which plummeted by 90 percent year-on-year to 75 million euros.

The drop means more customers are expected to pay back loans, signalling confidence in the economic recovery after the pandemic disruptions.

Looking ahead, Deutsche said it expected group revenues to be "essentially flat" this year after a strong 2020.

Deutsche's bottom line was boosted by lower provisions for credit losses as the recovery from the pandemic lowers the risk borrowers will default on their loans
Deutsche's bottom line was boosted by lower provisions for credit losses as the recovery from the pandemic lowers the risk borrowers will default on their loans AFP / Armando BABANI

But the bank lifted its outlook for next year to 25 billion euros, up from a previous forecast of 24.4 billion, finance chief James von Moltke said.

In a conference call with reporters, he said Deutsche's asset management, investment, retail and corporate banking divisions were all on track to surpass their goals for 2022.

Shares in Deutsche were up 0.23 percent at 10.64 euros in Frankfurt shortly after 0900 GMT.

"All our businesses have contributed to the year-on-year profit growth," Deutsche CEO Christian Sewing said about the second quarter results.

"Our priority now is to continue with our disciplined execution of transformation, quarter by quarter."

Deutsche Bank last year posted its first annual profit since 2014, driven by gains at the investment banking division and cost-cutting measures.

Its worst-ever year came in 2016, when it lost 6.8 billion euros, mostly related to investment banking activities in the years around the financial crisis.

Deutsche is in the midst of a painful restructuring that includes shedding 18,000 jobs between 2019 and 2022 to reduce the number of employees globally to 74,000.

By the end of June, Deutsche said it still had a workforce of 83,800 employees.