NEW YORK (CNNMoney) -- U.S. stocks rallied to the highest levels since early August on Friday, as investors grew increasingly hopeful that a resolution to Europe's debt crisis is around the corner.
"There's more optimism that something to solve Europe's debt crisis will be in place by the end of the month," said Ryan Detrick, senior technical strategist at Schaeffer's Investment Research.
The Dow Jones industrial average () surged 267 points, or 2.3%, and the S&P 500 ( ) gained 23 points, or 1.9%. Both indexes closed at the highest levels since Aug. 3. The tech-heavy Nasdaq composite ( ) added 39 points, or 1.5%.
Friday's gains pushed the Dow back into positive territory for 2011, with all three indexes on track for their best monthly performance in more than a year.
But given the roller coaster ride over the past five days, stocks ended the week little changed: The Dow and S&P rose a littler over 1% for the week, while the Nasdaq fell 1%.
On Thursday, U.S. stocks erased a mid-afternoon drop and ended mostly higher, as European leaders confirmed that they will meet multiple times over the next week to approve a key plan to resolve Europe's debt crisis.
"Aware of what is at stake and under the watchful glare of the world, eurozone policymakers might finally put their differences aside and produce the goods at the forthcoming EC council meetings and G20 summit," said Jonathan Loynes, chief European economist at Capital Economics, in a note to clients.
French president Nicolas Sarkozy and German chancellor Angela Merkel said late Thursday that the elements of a comprehensive response to Europe's debt crisis will be discussed in depth at Sunday's European Council summit, and a plan is expected to be unveiled next Wednesday.
With expectations rising, investors pushed stocks up through the narrow range they've been trading between since early August. But, of course, the market remains vulnerable to any piece of bad news.
"Europe is clearly dominating, and the overall sentiment is still negative because there are still a lot of concerns," said Detrick. "If we hear that a possible solution is falling apart, we'd see stocks snap back."
Plus, even if a plan lives up to the market's expectations, it may not address the "root causes of the eurozone's problems," said Capital Economics' Loynes.
"In short, we doubt the crisis ends here," he added.
Meanwhile, on Friday afternoon, eurozone finance officials approved the of next installment of Greece's bailout money. However the €8 billion tranche still needs approval from the International Monetary Fund.
Companies: Investors were also heartened by a batch of positive corporate news.
"Overall, earnings have been better than expected, which reduces the chances of a double-dip recession," said Detrick. "It's encouraging to see strength in the companies driven by consumer spending, because that's a good sign for the broader economy."
Chipotle's () stock climbed after the Mexican food chain topped earnings and sales estimates for the third quarter. The company also improved its forecast for same-store sales for the year.
Shares of Harman International () jumped after the car equipment maker delivered earnings that trounced Wall Street's expectations.
Altera's () stock spiked after a Citigroup analyst said the company's soft sales guidance for the fourth quarter is likely too conservative.
Shares of Honeywell (Fortune 500) rose after the company beat earnings expectations and raised its forecast for the year.,
Shares of General Electric (Fortune 500) slid after the company announced earnings of 31 cents per share in the third quarter, up two cents from a year earlier and in line with expectations.,
Thursday night, Wells Fargo admitted that it sent the wrong bank statements to customers in Southern states -- but it wouldn't confirm news reports that thousands were affected.
Ford (Fortune 500) shares moved higher after Standard and Poor's upgraded the automaker's credit rating by two notches to BB+, just one level below investment-grade. The ratings agency cited Ford's deal with the United Auto Workers union.,
Groupon reduced the amount of money it hopes to raise in its initial public offering by 28% to $540 million. The company is putting 30 million shares up for sale, hoping they'll receive between $16 and $18 a piece.
Economy: Investors also tuned into speeches from three voting members of the Federal Reserve's policymaking committee for hints about whether the central bank is considering another asset-buying program to boost the economy.
Vice Chairman Janet Yellen said that the Fed is "prepared to employ our tools as appropriate to foster a stronger economic recovery in a context of price stability."
Minneapolis Fed President Narayana Kocherlakota, who voted against the Fed's latest plan to buy long-term bonds, said the Fed's "decision-making in 2011 has introduced a lack of clarity about its monetary policy mission."
Meanwhile, Dallas Fed President Richard Fisher, who also voted against the Fed's so-called Operation Twist, said additional liquidity "is not the answer to our problems," and called on lawmakers in Washington to step up to boost job creation.
In a speech Thursday evening, Fed Governor Daniel Tarullo called upon the Fed to start buying more mortgage-backed securities.
World markets: European stocks finished sharply higher. Britain's FTSE 100 ( ) rose 1.9%, the DAX ( ) in Germany added 3.6% and France's CAC 40 ( ) edged up 2.8%.
Asian markets ended mixed. The Shanghai Composite () slid 0.6%, the Hang Seng ( ) in Hong Kong ticked up 0.2% and Japan's Nikkei ( ) was flat.
Oil for December delivery gained $1.33, or 1.6%, to settle at $87.40 a barrel.
Gold futures for December delivery added $23.20, or 1.4%, to settle at $1,636.10 an ounce.
Bonds: The price on the benchmark 10-year U.S. Treasury fell, pushing up the yield to 2.20% from 2.18% late Thursday.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||3.90%||3.89%|
|15 yr fixed||2.96%||2.93%|
|30 yr refi||4.00%||4.00%|
|15 yr refi||3.06%||3.03%|
Today's featured rates: