NEW YORK — U.S. stocks closed higher Tuesday, recording one of their best days in an otherwise dreary month. Investors focused on hopes that China is poised to rev up its economic growth machine and that upcoming elections in Greece will help the country stay in the euro.

The Dow Jones industrial average closed up 125.86 points at 12,580.69, only the fifth gain this month. The index is still down 4.8 percent for May. The worsening of Spain’s finances and the possibility that Greece would drop out of the euro currency union have been the main culprits behind the decline.

The S&P 500 index rose 14.60 to 1,332.42. The Nasdaq rose 33.46 to 2,870.99.

LOS ANGELES — An index of home prices in 20 American cities slumped in March compared to a year earlier, but the slide was the slowest since December 2010. The S&P Case Shiller index of property values fell 2.6 percent after falling 3.5 percent in February.

On a seasonally adjusted basis, the index rose from the month before after a similar increase in February — the first two-month streak since a tax credit for homebuyers expired in spring 2010.

Home values showed year-over-year declines in 13 of the index’s 20 cities. Cities reaching new lows were Chicago, Las Vegas, New York, Atlanta and Portland, Ore. Phoenix had the most substantial increase, with prices rising 6.1 percent.

TORONTO — Struggling BlackBerry-maker Research in Motion said Tuesday it has hired J.P. Morgan and RBC Capital Markets to advise it and said there will be significant layoffs this year.

RIM said the advisers will evaluate various strategies, including opportunities to partner and license as well as other alternatives. RIM made no mention of a sale of the company ,but new CEO Thorsten Heins did not rule it out after RIM’s last earnings were released in late March.

RIM’s stock was halted in after-hours trading. When trading resumed shares fell more than 10 percent to $10.03.

NEW YORK — Sprint Nextel said Tuesday it will shut down the Nextel network as early as June 30 next year, cutting off service for its characteristic walkie-talkie-like Nextel phones.

Sprint already had said the shutdown would begin sometime next year, but had not set a date. It bought the Nextel network in 2005, and has lost money every quarter for the last four years as it has struggled with the cost of running two incompatible wireless networks.

MEMPHIS, Tenn. — FedEx said Tuesday it will expand in Latin America with its purchase of a Brazilian transportation and logistics company.

FedEx is buying Rapidão Cometa Logística e Transportes SA, one of the largest logistics companies in Brazil. Rapidão has been its authorized representative in Brazil for 11 years.

With Rapidão, FedEx is getting about 770 vehicles and trailers, approximately 9,000 workers in Brazil and 45 branches.

Staff and wire reports