Wall Street was just 1 percent short of a record-high close on Wednesday as a rebound in oil prices added to optimism sparked by a raft of earnings reports that beat low expectations.
Driven 15 percent higher since mid-February by a recovery in weak prices and helped by a softer dollar, the S&P 500 was less than 25 points below last May's all-time peak.
Investors were honing in on a flow of first-quarter results, including an upbeat report from VMWare and a disappointing scorecard from Coca-Cola. Qualcomm (QCOM.O) was set to report after the bell.
Weighed down by the energy sector, first-quarter earnings at S&P 500 companies are expected to have slumped 7.5 percent on average, according to Thomson Reuters I/B/E/S.
Due to the market's recent oil-fueled gains and the tempered outlook for corporate profits, the S&P 500 is trading at about 17.8 times expected earnings, its most expensive level since 2004, according to Thomson Reuters Datastream.
Crude on Wednesday gained about 2 percent after a report showed U.S. inventories grew less than expected last week. [O/R]
"This market has been riding a wave of relief," said Alan Gayle, director of asset allocation at RidgeWorth Investments in Atlanta, Georgia. "But the good news has to keep on coming for this market to keep moving higher."
Data on Wednesday showed U.S. home resales rose more than expected in March, pointing to a continued recovery in the housing market, despite signs of sluggish first-quarter economic growth.
The Nasdaq Composite .IXIC added 0.51 percent to 4,965.57.
Seven of the 10 major S&P sectors were higher, led by a 1.47 percent rise in energy .SPNY.
Better-than-expected quarterly profits pushed several stocks higher, with VMWare (VMW.N) jumping 13.7 percent, Discover Financial Services (DFS.N) rallying 7.5 percent, St. Jude Medical (STJ.N) gaining 4.1 percent and Yahoo (YHOO.O) rising 4.6 percent.
Coca-Cola (KO.N) fell 4.1 percent after sales dropped for the fourth straight quarter.
Lexmark (LXK.N) jumped 9.5 percent after it agreed to be taken private by a group of investors led by China-based Apex Technology Co and PAG Asia Capital in a deal valued at $3.6 billion net of cash.
Advancing issues outnumbered decliners on the NYSE by 1,900 to 1,060. On the Nasdaq, 1,724 issues rose and 1,037 fell.
The S&P 500 index showed 23 new 52-week highs and no new lows, while the Nasdaq recorded 49 new highs and 14 lows.
(Additional reporting by Abhiram Nandakumar in Bengaluru; Editing by Chizu Nomiyama)
This story has not been edited by Firstpost staff and is generated by auto-feed.