U.S. stocks closed out their second straight week of gains on Friday with a rally sparked after Egyptian President Hosni Mubarak resigned, easing tension around the region for now.

The S&P's five-month surge, which has taken it up almost 27 percent, has confounded those calling for a correction, but weak volume recently has been undercutting the unfailingly bullish direction in equities. Only 7.7 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, below last year's daily average of 8.47 billion.

The volume suggests that maybe we're getting waning interest and a narrowing of the market, said James Gaul, portfolio manager at Boston Advisors LLC in Boston, which manages $1.7 billion.

Financials led on the back of the reduced uncertainty, rising throughout the trading day. Bank of America Corp gained 1.9 percent to $14.77 and the KBW Banks index <.BKX> added 1.8 percent.

Market Vectors Egypt Index ETF rallied on record volume the news, climbing 4.5 percent to $18.60.

Two weeks of anti-government protests in Egypt sparked concerns the unrest could spread across the Middle East, contributing to volatility in markets and commodity prices worldwide.

If things deteriorated in Egypt that would have created a risk for U.S. markets, especially if the Suez Canal was closed, Gaul said. We've removed a short-term uncertainty and are seeing a positive reaction as a result.

He added that some uncertainty persisted. Vice President Omar Suleiman said a military council would run Egyptian affairs, but some have questioned the army's appetite for real democracy.

The Dow Jones industrial average <.DJI> was up 43.97 points, or 0.36 percent, at 12,273.26. The Standard & Poor's 500 Index <.SPX> was up 7.28 points, or 0.55 percent, at 1,329.15. The Nasdaq Composite Index <.IXIC> was up 18.99 points, or 0.68 percent, at 2,809.44.

For the week, the Dow is up 1.5 percent and both the S&P and Nasdaq are up 1.4 percent.

Kraft Foods Inc limited gains in the Dow on Friday a day after it cut its 2011 profit growth forecast, sending the stock down 1.4 percent to $30.66, the biggest percentage decliner on the blue-chip index.

Shares of mortgage insurers rose after the Obama administration presented options for overhauling the wrecked U.S. housing finance system. It pledged to continue backing existing obligations of government-controlled mortgage finance sources Fannie Mae and Freddie Mac .

PMI Group
shares rose 2.8 percent to $3.34 and Radian Group gained 13.4 percent to $8.03.

A drought in Northern China has hit 7.7 million hectares of winter wheat growing areas, which, coupled with strong demand, is lifting some agricultural processor stocks, according to optionMonster co-founder Jon Najarian.

Agribusiness Bunge Ltd rose 3.4 percent to $71.36 and Archer-Daniels Midland Co gained 2.2 percent to $36.22.

Commodities were a weak spot as crude oil prices declined in parallel with a falling-off of worries of possible oil supply problems in the Middle East. March crude futures dropped 1.5 percent.

Nokia , the world's largest cellphone maker, and Microsoft teamed up to build an iPhone challenger in an attempt to take on Google and Apple in the fast-growing smartphone market.

U.S.-listed shares of Nokia slumped 14 percent to $9.36. Dow component Microsoft was 0.9 percent lower at $27.25.

Almost three stocks rose for every one that fell on the New York Stock Exchange. More than two stocks rose for every decliner on the Nasdaq.

(Editing by James Dalgleish)