NEW YORK/LONDON (Reuters) - Gold rallied more than 2 percent to a four-month high on Friday as the dollar slumped against the euro, oil soared to a record high and equity markets floundered on credit crisis fears.

Spot gold surged to $964.75/966.75 an ounce by 4:11 a.m. EDT from $944.10/445.30 an ounce late Thursday. It touched a session high of $967.60, its strongest since March 19.

New York August gold futures jumped $18.60, or 1.97 percent, to finish at $960.60 an ounce on the COMEX division of New York Mercantile Exchange. The session high of $969.10 an ounce also was last seen on March 19.

“It was a combination of things like the weakness in the dollar, crude making new all-time highs sparked some buying. Some concerns about the Fannie and Freddie situation weighing on equities and lead to safe-haven buying in gold,” said David Meger, metals analyst Alaron Trading, Chicago.

Oil prices jumped $5 to a record high above $147 a barrel, fueling early gains in gold. Geopolitical tensions involving Iran fueled an early crude rally.

Fears of unrest in Nigeria and a looming strike of Brazilian oil workers also buoyed oil prices. Gold also rose, as the precious metal often is bought as a hedge against oil-led inflation.

UBS analyst John Reade said “oil, weakness in the dollar and issues with the agencies” are driving gold higher.

Meanwhile, the dollar tumbled to its lowest since April 23 against the euro as stock prices slipped on Wall Street and in Europe. Gold, which often moves opposite the dollar, extended gains.

Worries about the stability of two U.S. government-backed mortgage finance giants Fannie Mae FNM.N and Freddie Mac FRE.N were thought to be constraining the Federal Reserve's ability to raise U.S. interest rates. This fed inflation fears, which also hurt the dollar.

U.S. stock prices tumbled broadly on fears that record oil prices and problems at Fannie Mae and Freddie Mac could slow the economy. Weak stocks buoyed gold in a flight to safety.

“Risk aversion has been sweeping through the markets this week,” said Calyon metals analyst Robin Bhar. “Obviously gold does well when there’s heightened risk aversion, (such as) concerns about ... the financial system.”

Platinum rallied late in the session, profiting from gold’s rise and as signs of firmer Chinese demand for the metal used in autocatalysts, as well as ongoing supply fears linked to the South African supply shortage fuelled buying.

Spot platinum firmed to $2,023.0/2,043.0 an ounce by late in New York, having earlier hit a one-week high of $2,045.00 an ounce.

Among other precious metals, spot palladium rose to $448.50/456.50 an ounce from $449.00/457.00 an ounce late in New York, while silver advanced to $18.76/18.84 an ounce from $18.28/18.33 late in New York.