NEW YORK – Stocks rose Wednesday, sending the Standard & Poor’s 500 Index higher for a third day, as French President Nicolas Sarkozy and German Chancellor Angela Merkel said they are convinced Greece will remain in the eurozone.

The S&P 500 gained 1.4 percent to 1,188.68, rallying 3 percent in three days. All 10 groups in the S&P 500 advanced. The index pared a gain of as much as 2.5 percent in the final minutes of trading. The Dow Jones industrial average rose 140.88 points, or 1.3 percent, to 11,246.73.

“It’s a psychological lift,” Peter Sorrentino, a senior money manager at Huntington Asset Advisors in Cincinnati, said in a telephone interview. The firm oversees $14.8 billion. “The Europeans haven’t given up hope. It buys them another day. There’s a desire to keep the euro strong. The question is, do they have the mechanism in place to avoid a domino effect?”

Concern the global economy was slipping back into a recession amid a worsening European debt crisis triggered an 18 percent plunge in the S&P 500 between the end of April and Aug. 8. Since then, the index has rebounded 6.2 percent.

Following a telephone conversation with Greek Prime Minister George Papandreou and Sarkozy, Merkel is convinced the future of Greece is inside the euro area, government spokesman Steffen Seibert said. The fulfillment of Greece’s adjustment program is “more than ever” essential and is a condition for the payment of further aid installments, Merkel said in an emailed statement.

Papandreou committed to meet deficit-reduction targets demanded as a condition for an international bailout, according to statements distributed by Athens and Paris, easing concerns Greece may default on its debt.

Stocks also rallied on optimism that China may support Europe. China is willing to buy the bonds of nations hit by the debt crisis, Caijing magazine reported, citing Zhang Xiaoqiang, a vice chairman of the National Development and Reform Commission.

GE advanced 2.5 percent to $15.79. Home Depot jumped 2.7 percent to $33.54. Monsanto climbed 3.1 percent to $69.47. FedEx added 1.4 percent to $76.01.

Dell increased 3.3 percent to $14.86. It approved an additional $5 billion for its stock repurchases, adding to the $2.16 billion remaining from prior authorizations at the end of the fiscal second quarter, which ended in July. The company spent $1.6 billion on buybacks through the first half of the year.