Stocks rallied on Thursday as Wells Fargo gave preliminary first-quarter results that were stronger than expected, providing a ray of hope in the struggling financial sector.

Wells Fargo shares jumped 20.7 percent to $17.97 after the bank said it expects to report a record $3 billion in net income for the first quarter.

In addition, a source familiar with talks told Reuters U.S. officials will not look to close any banks based on the results of stress tests being conducted to determine how the largest U.S. banks would fare under more adverse economic conditions. The news backed up an earlier media report.

The state of banks has been a key factor behind the stock market's sentiment. The current rally from early March began when several banks reported a reassuring start to the year.

Shares of JP Morgan Chase rose 11.7 percent to $30.65, making it the Dow's top performer, while Bank of America surged 20.8 percent to $8.53. The KBW Bank index <.BKX>jumped 10.8 percent. The index is on track for its longest weekly winning streak since the fall of 2006.

The market is reacting to the lifting of guidance from Wells Fargo this morning, said Fred Dickson, market strategist and director of retail research at D.A. Davidson & Co in Lake Oswego, Oregon.

We're in a market that is hungry for what I call rays of sunshine or glimmers of hopes on company fundamentals and economics.

But he added: It is still going to remain a bank-to-bank issue. I don't think one can generalize and make a blanket statement that all the bank results are going to be slightly better than what is currently expected.

The Dow Jones industrial average <.DJI> climbed 172.67 points, or 2.20 percent, to 8,009.78. The Standard & Poor's 500 Index rose 20.93 points, or 2.54 percent, to 846.09. The Nasdaq Composite Index <.IXIC> shot up 46.79 points, or 2.94 percent, to 1,637.45.

An S&P index of retailers' stocks rose 3.3 percent, helped by better-than-expected same-store sales at department stores such as Macy's Inc , up 11.4 percent at $11.50.

In contrast, the stock of Dow component Wal-Mart Stores Inc fell 4.4 percent to $50.32 after the company reported a lower-than-expected 1.4 percent increase in March sales at U.S. stores open at least a year. But the discount retailer also forecast quarterly earnings at the high end of its previous view.

Apple Inc led the Nasdaq higher, rising 2.5 percent to $119.21 after Credit Suisse lifted its price target on the stock to $133 from $120.

On the merger front, shares of Textron Inc , the top percentage gainer on NYSE, skyrocketed almost 50 percent to $13.64 after a Kuwaiti newspaper reported that a consortium of Middle Eastern companies was looking to buy the diversified U.S. manufacturer. Textron declined to comment.

At its current pace, the S&P 500 will advance for the fifth consecutive week and is up more than 25 percent since the 12-year closing low reached on March 9.

U.S. markets are closed tomorrow for the Good Friday holiday.

(Editing by Jan Paschal)