U.S. stocks rose on Friday as investors welcomed news that Egyptian President Hosni Mubarak resigned, easing concerns that have been weighing on the market for weeks.

As Mubarak stepped down, Egypt's vice president named a military council to run the country after 18 days of mass protests, state television said.

Market Vectors Egypt Index ETF rallied on the news, up 6.3 percent to $18.93.

The markets are clearly celebrating the end of Mubarak. I think that is a speculative thing to do -- it may work, and you may find out that it is way too soon to celebrate the crisis is over, said David Kotok, chief investment officer at Cumberland Advisors in Sarasota, Florida.

Domestically, the Obama administration declared the public-private housing finance model in place for the past four decades was dead but pledged to continue backing existing obligations of Fannie Mae and Freddie Mac .

Shares of mortgage insurers rose, with PMI Group
up 6.8 percent to $3.47 and Radian Group 13 percent higher at $8.00.

The Dow Jones industrial average <.DJI> was up 31.79 points, or 0.26 percent, at 12,261.08. The Standard & Poor's 500 Index <.SPX> was up 5.25 points, or 0.40 percent, at 1,327.12. The Nasdaq Composite Index <.IXIC> was up 8.87 points, or 0.32 percent, at 2,799.32.

On the S&P 500, the energy sector was the weakest performing after oil prices declined along with worries of possible oil production disruption in the Middle East.

One thing that has weighed on investor sentiment is that the price of oil would go up in the case of political turmoil, and Mubarak's leaving reduces that possibility, said Gary Thayer, chief macrostrategist at Wells Fargo in St. Louis, Missouri.

Crude oil prices declined on the news and we're seeing gold come off a little bit.

U.S. crude futures were down 0.6 percent to $86.22 a barrel.

The market was pressured from the open by escalating concerns over Egypt but later recovered on gains in financial and industrial shares.

The trend of investors buying on the dips has been seen frequently in the past few days, suggesting equities are positioned to rally further.

(Reporting by Angela Moon, Editing by Kenneth Barry)