Goldman Sachs reported Tuesday that its quarterly profit fell by more than half and revenue slumped to its lowest level in more than four years. (Brendan Mcdermid/Reuters)

Goldman Sachs, one of the most prominent banks on Wall Street, is having a difficult year. It agreed to a $5 billion settlement with federal authorities earlier this month over selling shoddy mortgage loans. Its stock is down nearly 10 percent so far in 2016.

And on Tuesday, the megabank reported that its quarterly profit fell 56 percent.

“The operating environment this quarter presented a broad range of challenges, resulting in head winds across virtually every one of our businesses,” Lloyd Blankfein, the company’s chief executive, said in a statement.

But as with the rest of Wall Street, Goldman’s dismal year is not as bad as it appears. Goldman still managed to report a net profit of $1.14 billion during its first quarter. The New York bank will be able to deduct some of its $5 billion settlement from its taxes. And its stock price rose more than 2 percent Tuesday.

Goldman is the last of the big banks to report lackluster financial results for the first few months of the year. Net income dropped 53 percent at Morgan Stanley and 7 percent at JPMorgan Chase, the country’s largest bank by assets. At Wells Fargo, profit fell 5 percent.

But each still raked in billions in profit. JPMorgan led the pack with $5.9 billion in the first quarter.

“We’re earning decent returns. We have good margins,” Jamie Dimon, JPMorgan’s chief executive, told analysts during a conference call last week when asked about the bank’s trading business. “I would look at it as quite a good performance.”

The financial sector has been whipsawed lately by a volatile stock market, which experienced weeks of deep declines and falling oil prices, before recovering more recently. Analysts have fretted that U.S. banks could take heavy losses from the loans they made to energy companies during better times. In fact, Bank of America raised the amount it has set aside for losses on loans to oil and gas company to $1 billion during the first quarter, and Wells Fargo is setting aside $1.7 billion.

“The expectations were for a truly terrible [first quarter], and that did not come to pass,” said Erik Oja, an analyst at S&P Global Market Intelligence. “They are jumping over a very low bar.”

Now, market conditions have begun to improve. Stocks have bounced back from their deep losses earlier this year and oil prices have edged back up. And when compared with their European counterparts, the U.S. banking industry is thriving. German behemoth Deutsche Bank reported a $7.6 billion loss last year.

“When you look at the losses that European banks are taking, the U.S. banks look remarkably strong,” Oja said.

This comes at a time when Wall Street is under a microscope. Sen. Bernie Sanders (Vt.), a Democratic presidential candidate, has repeatedly called for a breakup of the big banks, saying they are still too big and pose a threat to taxpayers. That message gained energy last week when federal regulators ruled that five of the country’s largest banks, including Bank of America and JPMorgan, do not have a credible plan for winding down their operations without taxpayer help if they start to fail.

If the banks do not come up with “living wills” acceptable to regulators by October, they could be forced to increase their financial cushion and take other measures that could eat into profits.

“I think that if they don’t get the living wills approved, the regulators have shown that they will be merciless,” Oja said.