The U.S. stock market ended the week on a high note, capping a four-day rally that saw both the Dow Jones industrial average and the Standard & Poor’s 500-stock index enjoy their best week of the year.

The Dow rose 93 points on Friday to close at 12,554 points, up 3.6 percent from the end of last week.

The S&P 500 was up 0.81 percent Friday, after staying mostly flat following a dramatic rally on Wednesday.

The gains came ahead of a weekend meeting by European officials that will include discussions of a possible international bailout for Spain’s cash-strapped government.

“Next week is totally going to depend on the headlines, sadly,” said Meg Green, chief executive of a Miami wealth management firm that bears her name.

Analysts said they were encouraged by reports of constructive talks in Europe.

“I get a sense that there is a relaxation of some of the tension,” said Bernie McGinn, founder and chief executive of Alexandria-based McGinn Investment Management.

The rally Wednesday on global markets, which saw the Dow rise by more than 2 percent, was spurred by hopes that both the U.S. Federal Reserve and the European Central Bank would take action to boost economic growth.

Several Fed officials have said new stimulus measures are under consideration. But when Fed Chairman Ben S. Bernanke testified on Capitol Hill on Thursday, he gave investors little reason for further optimism, offering no clear indication of whether he would push for new measures aimed at easing the nation’s doggedly high unemployment.

Although ECB President Mario Draghi said this week that his central banks would take necessary action to stabilize the European economy if necessary, the ECB did not take new measures when it met this week.

Investors received an unexpected boost, however, from China, which announced interest rate cuts aimed at invigorating its slowing economy.

In comparison with the beating stocks have taken in the past few weeks, especially after a discouraging U.S. government report on unemployment earlier this month, the market is looking up, said analysts.

U.S. companies and the financial markets remain largely healthy, despite talk about overseas concerns, they added.

“Banks are lending money,” McGinn said. “They have money to lend.”

Analysts also said the rally Wednesday was the result of the market being oversold the previous week, when investors dumped stocks out of concern over the escalating European crisis and dismal U.S. jobs report.

In the short-term, investors can still expect volatility, and the onus lies completely on policymakers, analysts added.

“We will still have some bouts of crisis management,” said James Dunigan, managing executive for PNC Wealth Management.

The outcome of this weekend’s European talks, the Fed’s policy meeting scheduled for June 19 and economic uncertainty associated with the presidential election campaign could all play havoc with markets, according to analysts.