Deutsche Bank AG DB, -2.39% racked up a loss of $1.6 billion over nearly a decade on a complex municipal-bond investment that it bought in the runup to the 2008 financial crisis, and failed to confront head-on even as markets were upended and regulations tightened.

The loss, which hasn’t previously been reported, represents one of Deutsche Bank’s largest ever from a single wager—roughly quadruple its entire 2018 profit—and ranks as one of the banking industry’s biggest soured bets in the last decade.