Getting your Trinity Audio player ready...

A ray of hope in the troubled banking sector propelled stocks to their best gain in four months Tuesday, offering investors at least temporary respite from the downturn that has gripped the market this year.

The Dow Jones industrial average bolted almost 400 points after the chief executive of Citigroup Inc. said the banking company was profitable in the first two months of this year and is having its best quarter since late 2007.

That pushed the firm’s stock up 38 percent, or 40 cents a share, to close at $1.45.

The announcement stirred hope that banks could stave off nationalization and provide enough credit to help spur an economic recovery.

“Just the idea that some of our most important financial institutions might not be amongst the walking dead was enough to boost investor confidence,” said John Bollinger of Bollinger Capital Management in California.

The broad advance raised the prospect that stocks could be poised for a short-term rally after an almost uninterrupted slide this year.

But the gain probably doesn’t signal an end of the bear market, which like the economy faces daunting head winds, experts said.

The Dow industrials soared 379.44 points, or 5.8 percent, to 6,926.49. The index climbed back to where it was about a week-and-a-half ago but remains down 21 percent this year. It is off 51 percent, or more than 7,000 points, from its record in October 2007.

The Standard & Poor’s 500 index jumped 43.07 points, or 6.4 percent, to 719.60. The Nasdaq composite index shot up 89.64 points, or 7.1 percent, to 1,358.28.