U.S. stocks rose on Friday after President Hosni Mubarak resigned, helping clear Egypt's clouded political picture and lifting investor sentiment.

Two weeks of anti-government protests in Egypt had given rise to concern the unrest could spread across the region and contributed to volatility in markets worldwide.

There was concern that this could lead to rising commodity prices and a flight to the dollar and now some of that uncertainty has been removed, said Matthew Keator, partner in the Keator Group, a wealth management firm in Lenox, Massachusetts.

Market Vectors Egypt Index ETF rallied on the news, soaring 4.7 percent to $18.64 and setting a record for daily volume.

Egyptian Vice President Omar Suleiman said a military council would run the affairs of the most populous Arab nation. A free and fair presidential election has been promised for September, though some questioned the army's appetite for real democracy.

There's still uncertainty over the region, Keator said. And there's still potential for commodity prices to rise from this in the future.

The Dow Jones industrial average <.DJI> was up 38.52 points, or 0.31 percent, at 12,267.81. The Standard & Poor's 500 Index <.SPX> was up 6.77 points, or 0.51 percent, at 1,328.64. The Nasdaq Composite Index <.IXIC> was up 16.83 points, or 0.60 percent, at 2,807.28.

Kraft Foods Inc limited gains in the Dow a day after it cut its 2011 profit growth forecast, sending the stock down 1.8 percent to $30.55, 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. The administration pledged to continue backing existing obligations of government-controlled mortgage finance sources Fannie Mae and Freddie Mac .

PMI Group

shares rose 3.4 percent to $3.36 and Radian Group gained 13.4 percent to $8.02.

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.2 percent to $71.24 and Archer-Daniels Midland Co gained 1.8 percent to $36.09.

On the S&P 500, the energy sector was one of the weakest performers as oil prices declined in parallel with a falling-off of worries of possible oil supply problems in the Middle East. The sector <.GSPE> fell 0.2 percent while March crude futures dropped 1.3 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 16.2 percent to $9.12. Dow component Microsoft was 0.8 percent lower at $27.27.

(Editing by James Dalgleish)