New York - US shares got a solid boost on Tuesday from an upturn in Chinese inflation and a possible deal on the next stage of Greece's bailout to avert a looming crisis.
Markets also got a boost from a rebound in commodities led by oil prices.
Banks, industrial firms like Caterpillar and Boeing and other blue-chips led the rally, while Amazon was the best gainer among large-cap stocks after it laid out a challenge to Google-owned YouTube with its own streaming of member-generated content.
At the close, the Dow Jones Industrial Average was up 1.3%t to 17 928.35.
The broad-based S&P 500 rose 1.3% to 2 084.39, while the tech-rich Nasdaq Composite also gained 1.3% to 4 809.88.
"That strong dollar-weak oil situation has been eliminated," said Art Hogan at Wunderlich Securities.
"It's a risk-on day; underperformers are doing better. It's a very good transition," Hogan said.
Fashion group Gap fell 11.5% after a disappointing first-quarter sales figure of $3.44bn pointed to its continuing struggle to deal with a sharply shifting market for young people's clothing in its main Gap, Banana Republic and Old Navy chains.
Drugmaker Allergan rose 5.3% after its board authorised up to $10bn in share repurchases, including $4-5bn over the next four to six months.
Medivation, the San Francisco biotech company developing cancer therapies, fell 0.9% after it said it was giving Pfizer and Amgen access to its books to support possible takeover bids.