Deutsche Bank AG said its first-quarter profit jumped on strong client activity, despite an uncertain business environment related to the war in Ukraine and surging inflation.

However, warnings on costs and a fall in its key capital-buffer ratio worried investors, who drove the bank’s shares down close to 6%.

The capital cushion the bank has to absorb future losses fell unexpectedly to 12.8% from 13.2% in the fourth quarter, due to the reclassification of some assets as riskier, which are used to calculate the ratio. That is still above its target of 12.5%, and Chief Financial Officer James von Moltke said it would be maintained as the bank generates higher income.

He also said competition for talent was putting pressure on the bank’s payroll, although it still managed to lower costs by 4% in the quarter.

The bank reported an 18% rise in net profit for the quarter to €1.23 billion, the equivalent of $1.3 billion—the highest in nine years. The profit was higher than an average analyst consensus of €1.11 billion. Revenue at its corporate bank rose 11%, and 7% at its investment bank.

“The first quarter was about demonstrating our resilience,” Mr. von Moltke said. In a message to staff, Chief Executive Christian Sewing said the global economic outlook was deteriorating, while inflation rates continued to rise.

Customers long turned off by the bank’s troubles are returning, due to a focus on its core businesses and success at cutting costs. Revenue at its key fixed-income business rose 15%, outperforming most of its U.S. peers. Debt and equity origination, however, fell given the economic and geopolitical uncertainty.

Deutsche Bank has promised to meet a series of financial goals this year, but the bank’s visibility over the rest of the year has been clouded by the war in Ukraine.

Deutsche Bank, like its European and U.S. lending peers, has reported a relatively small direct exposure to Russia and Ukraine. It said its gross loan exposure to Russia stood at €1.3 billion, much of it guaranteed. But the war has triggered an increase in commodity and energy prices, and fears of an economic slowdown in the continent that would hurt borrowers.

The bank increased provisions for bad loans in the quarter to €292 million, compared with €69 million a year ago.

Mr. von Moltke said the bank wasn’t seeing any borrower trouble so far. But the bank warned in its results report that sudden and deeper interest-rate increases by central banks in response to high inflation could cause a “sharply negative reaction in financial markets and most likely a significant economic recession in the U.S. as well as in Europe.”

The bank, which for years struggled with a combination of financial scandals, fines and low profitability, has been improving its prospects under an overhaul that Mr. Sewing began in 2019, shortly after it dropped a bid to merge with smaller rival Commerzbank AG

.

Under Mr. Sewing’s direction, it has cut costs, exited equities trading and vowed to focus on its strengths, including fixed-income trading and cash management.

It recently suffered a setback when U.S. investment firm Capital Group Cos. dumped its roughly 5% stake in the bank, months after another large investor, Cerberus Capital Management, sold its shares.

This year, it committed to deliver to investors a series of targets, including an 8% return on tangible equity—a key metric for profitability. It is also said it would reach a cost-to-income ratio, a measure of efficiency, of 70%.

In the first quarter, the return on equity stood at 8.1%. Its cost-to-income ratio was at 73.4%.

Write to Patricia Kowsmann at patricia.kowsmann@wsj.com