U.S. stocks posted their best day since March with gains of more than 1 percent on Tuesday, following encouraging reports on the housing market and sharp gains in European stocks.
"Certainly we followed Europe on the weaker euro even though a strong dollar's not really good for U.S. stocks, and obviously the new home sales (helped)," said Peter Boockvar, chief market analyst at The Lindsey Group. He said much of the gains were "noise" and noted the S&P has recently held in a range between 2,040 and 2,100.
Toll Brothers closed 8.7 percent higher in its best day since April 23, 2013. (Tweet This) The luxury homebuilder reported earnings that beat on both the top and bottom line, as the company sold more luxury homes at higher prices, mainly in California. The firm also raised its forecast for home sales.
New home sales for April jumped 16.6 percent to a seasonally adjusted annual rate of 619,000 units, topping expectations and the highest level since January 2008. The SPDR S&P Homebuilders ETF (XHB) closed 3 percent higher for its best day since September.
"You've got to see some pockets of growth if the Fed is going to raise rates and you've got the new home sales and the derivatives of home sales," said Quincy Krosby, market strategist at Prudential Financial.
Other economic news was disappointing. The Richmond Fed manufacturing index for May showed minus 1, down from a positive read of 14 in April. The index for shipments fell to minus 8 in May, while new orders fell to 0 from 18 in April.
The Dow Jones industrial average and S&P 500 posted their best day since March 11. Tech jumped 2 percent and financials and health care rose about 1.5 percent each to lead all S&P sectors higher.
"The market is somewhat being driven by momentum as we get closer to the upper end of the trading range here," said Peter Cardillo, chief market economist at First Standard Financial.
The Nasdaq composite outperformed, closing 2 percent higher for its best day since March 1 and above its 50-day and 200-day moving average. Apple closed up 1.5 percent, while the VanEck Vectors Semiconductors ETF (SMH) closed 2.4 percent higher and the iShares Nasdaq Biotechnology ETF (IBB) closed up nearly 2.3 percent.
The Russell 2000 climbed more than 2 percent to close above its 200-day moving average for the first time since May 10.
"I just think we came into a positive tone, which was European equities doing better," said Art Hogan, chief market strategist at Wunderlich Securities.
He attributed gains in Europe to euro weakness against the U.S. dollar, general improvement in European data, and a poll showing less support for the U.K. leaving the European Union.
A poll from ORB published in Tuesday's edition of the Telegraph newspaper showed that, among those who definitely plan to vote, support for Britain remaining in the European Union stood at 55 percent, while that for Brexit was at 42 percent.
Pound sterling traded near $1.463, around its highest since May 19.
The U.S. dollar index was up more than a third of a percent, near highs not seen since late March, with the euro around $1.114 after hitting its lowest against the dollar since mid-March. The yen was near 110 yen against the greenback.
The major European indexes closed more than 2 percent higher, with the German DAX posting its best day in five weeks. The Euro STOXX Banks Index rose nearly 3.5 percent for its best day since April 13.
"I think perhaps the market's rallying a little bit on a pullback of the likelihood of 'Brexit,'" said Jack Ablin, chief investment officer at BMO Private Bank.
In other regional economic news, a survey by think tank ZEW showed the mood among analysts and investors worsened unexpectedly in May, with its German economic sentiment index falling to 6.4 points, Reuters reported. The think tank cited uncertainties around Britain's possible departure from the European Union and doubts the economy would continue hold the first quarter's momentum.
Meanwhile, Germany's DIHK Chambers of Industry and Commerce raised its 2016 growth forecast for the German economy to 1.5 percent from a previous estimate of 1.3 percent, supported by construction and consumption. The DIHK said Germany was getting little impetus from foreign demand and that the economy would grow at a slower pace in coming months, Reuters reported.
Ahead of weekly inventory data due late Tuesday and Wednesday morning, U.S. crude oil futures settled up 54 cents at $48.62 a barrel, its highest since October.
Brent ended half a percent higher at $48.61 a barrel, marking the first settle below WTI since January.
The Treasury Department on Tuesday sold $26 billion in two-year notes at a high yield of 0.92 percent. The briefly turned lower after the auction before holding higher around 0.91 percent. Earlier, the yield hit 0.93 percent, its highest since mid-March.
The 10-year yield traded off session highs around 1.86 percent.
Late Monday, Philadelphia Fed President Patrick Harker said the Fed will likely raise interest rates two or three times this year. Harker is an alternate member of the FOMC this year.
Katie Stockton, chief technical strategist at BTIG, attributed the gains in S&P futures to an oversold bounce in European markets.
"We think U.S. equities will have an upward bias this week, supported by short-term positive divergences, but we expect resistance at the April highs to remain largely intact," she said in a morning note.
In other earnings news, Best Buy reported earnings that beat on both the top and bottom line but gave current-quarter forecast below Street forecasts. Separately, Best Buy CFO Sharon McCollam is stepping down June 14, and will be replaced by Chief Strategic Growth Officer Corie Barry. Shares closed 7.4 percent lower.
AutoZone posted earnings that missed expectations and revenue below estimates, primarily due to weather-related factors in certain areas of the country and a legal charge, the autoparts retailer said in a release. Shares gained nearly 2.5 percent.
In Asia, stocks closed mostly lower with the Shanghai composite off nearly 0.8 percent and the Nikkei 225 ending 0.9 percent lower. The Hang Seng closed 0.1 percent higher.
The closed up 28.02 points, or 1.37 percent, at 2,076.06, with information technology leading all 10 sectors higher.
The Nasdaq composite closed up 95.27 points, or 2.00 percent, at 4,861.06.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, declined to trade near 14.5.
About three stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of 874 million and a composite volume of nearly 3.6 billion in the close.
Gold futures for June delivery settled down $22.30 at $1,229.20 an ounce.
—CNBC's Peter Schacknow and Reuters contributed to this report.
On tap this week:
Earnings: Hewlett Packard Enterprise, Intuit
Earnings: Tiffany, Express, Bank of Montreal, National Bank of Greece, HP, NetApp, PVH, Guess, Lionsgate, Popeyes Louisiana Kitchen, Pure Storage
8:30 a.m. International trade
9 a.m. Philadelphia Fed President Patrick Harker
9 a.m. FHFA HPI
9:45 a.m. Markit services PMI
11:40 a.m. Minneapolis Fed President Neel Kashkari
1 p.m. $34 billion five-year note auction
1:30 a.m. Dallas Fed President Rob Kaplan
Earnings: Dollar General, Signet Jewelers, Abercrombie & Fitch, Chico's, Toronto-Dominion Bank, Palo Alto Networks, GameStop, Splunk
6:10 a.m. St. Louis Fed President James Bullard in Singapore
8:30 a.m. Initial claims
8:30 a.m. Durable goods
10 a.m. Pending home sales
12:15 p.m. Fed Gov. Jerome Powell
1 p.m. $28 billion seven-year note auction
Earnings: JA Solar
8:30 a.m. Real GDP Q1 (second)
10 a.m. Consumer sentiment
1:15 p.m. Fed Chair Janet Yellen receives award, in Q&A at Harvard
*Planner subject to change.
More From CNBC.com: