That also put more focus on Friday's government jobs data, which is among the most widely watched economic indicators.
"There's positioning ahead of that report," said Bucky Hellwig, senior vice president of BB&T Wealth Management in Birmingham, Alabama.
He also said "there was money moving in at the end of the quarter so now there's an upward bias."
The jobs report is expected to show that employers added 200,000 to nonfarm payrolls in March, the largest gain in four months, according to a Reuters poll of economists.
Eight of 10 S&P 500 sector indexes ended in positive territory, led by the consumer discretionary sector index, up 0.7%.
Also Read
Wednesday's data from payrolls processor ADP showed US private-sector employers added 191,000 workers in March, slightly below the 195,000 forecast, while gains in the previous month were revised to 178,000 from a previously reported 139,000, signaling that a winter-related impact on job growth earlier this year was easing.
Orders for long-lasting manufactured goods jumped 1.6% in February, the biggest rise since September and above a 1.2% estimate, the Commerce Department said. January's durable goods orders were revised to show a larger drop of 1.0% instead of the previously reported decline of 0.7%.
The Dow Jones industrial average rose 40.39 points or 0.24%, to end at 16,573. The S&P 500 gained 5.38 points or 0.29%, to finish at 1,890.90, a record closing high. The S&P 500 also hit an intraday record high of 1,893.17.
The Nasdaq Composite added 8.416 points or 0.20%, to close at 4,276.456.
Shares of MannKind Corp
Among the day's decliners, fertilizer company Agrium Inc
In another weather-related announcement, Delta Air Lines
Apollo Education Group Inc
DFC Global Corp
About 6.2 billion shares changed hands on US exchanges, slightly below the 6.5 billion average so far this month, according to data from BATS Global Markets.
Advancers beat decliners on the New York Stock Exchange by 1,721 to 1,289 and on the Nasdaq by 1,473 to 1,150.