Stocks recorded their third big gain of the week and closed at a one-month high Friday because of expectations that the central banks of countries around the world will step in to limit the damage from a debt crisis in Europe.
The Dow Jones industrial average climbed 115 points.
Now investors wait for a crucial election on Sunday in Greece that will help determine whether that country stops using the euro as its currency. Such an exit would destabilize financial markets.
Mario Draghi, president of the European Central Bank, said his institution stood ready to support Europe's banking system by continuing to lend money to solvent banks. He also appeared to leave open the possibility of an interest rate cut.
Draghi said in Frankfurt that the ECB has a "crucial role" in extending credit to banks in times of instability, when banks can't always borrow money on financial markets.
On Thursday, Reuters reported that ECB, the Federal Reserve, the Bank of England and other global financial authorities were ready to act in concert to limit the fallout from Greece.
Investors also are more confident about the election itself, said Peter Tuz, a money manager, at Chase Investment Counsel, which runs mutual funds.
"There's a growing sense of optimism," he said. "The betting now is that the 'let's stay in the euro' segment of the population will win."
Borrowing costs for Spain were unchanged. They fell slightly for Italy, an indication that investors are feeling a little better about that country's solvency. They have been worried that Italy will have to seek financial rescue.
The Dow rose 115.26 points to close at 12,767.17, its highest finish since May 11. The Standard & Poor's 500 index climbed 13.74 points to 1,342.84, also its highest since May 11. The Nasdaq composite index rose 36.47 points to 2,872.80.
For the week, the Dow rose 0.9 percent, the S&P 1 percent and the Nasdaq 1.3 percent.
The week included four moves of 100 points or more for the Dow, the first time that has happened since April:
*On Monday, the Dow lost 142 points as enthusiasm faded for a $125 billion rescue of Spanish banks.
*On Tuesday, the Dow climbed 162 after a Federal Reserve official said he supported more measures to stimulate the economy.
*On Thursday, the Dow gained 155, primarily because of late reports about possible coordinated action by central banks.
Energy stocks rose the most Friday. OPEC oil ministers agreed Thursday to keep their production target steady, a compromise meant in part to soothe economically troubled countries.
A pair of weak economic reports helped push Treasury prices up and yields down.
A report on U.S. factory production showed a drop in manufacturing, a key driver of economic growth. A gauge of manufacturing in New York sank to its lowest level since November.