By Leah Schnurr

The banking sector was in the spotlight throughout the session after a fresh $20 billion government capital injection for Bank of America revived worries about the fate of the sector.

"For better or for ill, we have to at least keep the banks going," said Paul Nolte, director of investments at Hinsdale Associates in Hinsdale Illinois. "Investors are struggling with what is happening and that's why we're seeing the volatility."

The S&P financial index <.GSPF> pared steep declines to end down 2.4 percent after Barclays said it expected next month to report pretax profit for 2008 "well ahead" of analysts' estimates. Barclays comments came a few hours after its shares had plummeted by 25 percent in European trade.

Energy shares rose along with a rebound in the price of oil, while McDonald's was the Dow's biggest lift, offsetting the drag from Bank of America and JPMorgan Chase & Co .

The Dow Jones industrial average <.DJI> rose 68.73 points, or 0.84 percent, to 8,281.22. The Standard & Poor's 500 Index <.SPX> gained 6.38 points, or 0.76 percent, to 850.12. The Nasdaq Composite Index <.IXIC> was up 17.49 points, or 1.16 percent, at 1,529.33.

For the week the Dow was down 5.6 percent, the S&P 500, lost 5.9 percent, while Nasdaq gave up 3.02 percent. The broad S&P 500 is now up almost 15 percent since the bear market low on November 21, after starting 2009 up about 20 percent from that level.

Markets will be closed on Monday for the Martin Luther King Jr. Day holiday, a day before the inauguration of President-elect Barack Obama.

Friday marked an end to the stock market's run under the administration of President George W. Bush. The S&P 500 lost more than 35 percent of its value since the day Bush took office in 2001, wiping out more than $4.6 trillion of investor wealth during his eight-year presidency.

By contrast, under his predecessor, William Clinton, the S&P tripled, gaining more than $9 trillion. Bush is the first president since Richard M. Nixon to preside over a net fall in stocks during his term.

On the heels of the financial lifeline for Bank of America, the bank posted its first quarterly loss in 17 years, while Citigroup also reported a hefty quarterly loss and said it plans to split into two units.

Bank of America and JPMorgan Chase & Co were the Dow's biggest drags, falling 13.7 percent to $7.18 and 6.2 percent to $22.82, respectively. Although JPMorgan is viewed as being healthier than Bank of America and Citigroup, it posted a hefty decline in quarterly profit on Thursday.

Despite the maneuvers surrounding the financial sector, analysts said worries persisted over the health of the group and whether banks will need to raise more capital as they struggle to deal with the credit crunch and global economic slowdown.

McDonald's gained 2.9 percent to $59.67 after its chief executive told CNBC television the company expected to continue paying dividends.

Energy shares, including Exxon Mobil , rose along with oil prices as short covering overshadowed a gloomy demand outlook. U.S. crude was up $1.11 to $36.51 a barrel, while Exxon gained 1.9 percent to $78.10.

Highlighting the deteriorating economy, there was no let up in companies announcing job cuts. Advanced Micro Devices Inc said it would cut 1,100 jobs, while The Wall Street Journal reported that drugmaker Pfizer Inc plans to lay off as many as 2,400 sales staff.

Trading was active on the New York Stock Exchange, with about 1.62 billion shares changing hands, below last year's estimated daily average of roughly 1.9 billion, while on Nasdaq about 2.29 billion shares traded, above last year's daily average of 2.17 billion.

Advancing stocks outnumbered declining ones on the NYSE by 2,012 to 1,036 while decliners beat decliners on the Nasdaq by about 1,480 to 1,206.

(Editing by Leslie Adler)