Stocks surged in the United States and Europe on Wednesday amid hopes that central banks on both sides of the Atlantic will take steps to stimulate economic growth.

The Dow Jones industrial average rose 286 points, or 2.37 percent, to record its best day of the year. The broader Standard & Poor’s 500-stock index was up 2.3 percent.

The sharp rise in global markets was especially welcome news because they have been falling in recent weeks over fear that Europe’s financial crisis is spreading and the anemic U.S. recovery is slowing.

Markets tumbled Friday after a disappointing employment report from the federal government showed that the economy added a paltry 69,000 jobs in May.

Wednesday’s rally was a product of a combination of factors, analysts said. Investors appeared to be responding to a heightened willingness by the Federal Reserve and the European Central Bank to bolster growth.

Although the ECB held off on cutting interest rates at its meeting Wednesday, ECB President Mario Draghi said the bank would be willing to take future steps to ensure economic stability if necessary.

Both the Euro Stoxx 50 index and the German DAX were up 2 percent.

“The message from the ECB had been that they would continue to do what was necessary,” said Michael Mussio, portfolio manager at FBB Capital Partners. “Domestically, the Fed is ready to step in.”

That was the sentiment Federal Reserve Bank of Atlanta President Dennis P. Lockhart conveyed at a speech in Florida on Wednesday. He said that the economy faced “strong headwinds” and that “further monetary actions to support the recovery” would have to be considered.

Fed Chairman Ben S. Bernanke is scheduled to testify Thursday before Congress, and his remarks should have a further effect on markets, analysts said. Investors and analysts will be watching closely to see what new measures the Fed could take when its policymaking committee meets this month.

Amid mounting concerns that the U.S. recovery could be stalling, the Fed has been under increased pressure to take steps to invigorate the economy. These could include a new round of massive bond purchases aimed at pumping billions of dollars into the economy.

Some analysts said the markets’ reaction to last week’s grim jobs report was too strong.

“The economy is growing, but not at the rate that people want it to,” said Frank Fantozzi, president of Cleveland-based Planned Financial Services.

Analysts remain cautious about what Wednesday’s rally means for the rest of the year. The rally could prove to be short-lived, said Fred Dickson, chief market strategist at D.A. Davidson & Co. Analysts said investors should concentrate on the long term.

Until the European crisis is brought under control and economic growth regains momentum, there will be volatility.

“We’re going to be better off in six months, but the ride to get there is going to be pretty choppy,” Fantozzi said.