(AP) -- Stocks overcame an early stumble and closed broadly higher Wednesday as the market more than made up its losses from a day earlier.
Retailers, health care and industrial companies notched solid gains. Financial and energy stocks also helped power the rally.
The two sectors have taken the heaviest losses this month as fear that the U.S. trade war with China is hampering global economic growth roiled markets.
"Markets are trading higher as investors await news on the China trade front," said Cayman Wills, global head of equities at J.P. Morgan Private Bank. "It's just the absence of bad news that's letting markets trade higher."
Evidence of investor anxiety could still be found in the bond market, as traders seeking safety snapped up U.S. government bonds. The trend continued to drive long-term bond yields further below short-term ones. The so-called inversion of the U.S. yield curve is a rare phenomenon that has correctly predicted previous recessions.
The yield in the 10-year Treasury fell below that of the two-year Treasury on Tuesday and remained lower Wednesday. The 10-year yield slid to 1.47%, down from 1.49% late Tuesday. The two-year dropped to 1.50% from 1.52%.
"You're seeing investors hedge their bets, but also take advantage of the pockets of opportunity in sectors that have been hurt by the 10-year yield coming down," said Quincy Krosby, chief market strategist at Prudential Financial.
The S&P 500 rose 18.78 points, or 0.7%, to 2,887.94. The Dow Jones Industrial Average climbed 258.20 points, or 1%, to 26,036.10. The Nasdaq recovered from an early slide, gaining 29.94 points, or 0.4%, to 7,856.88.
Investors favored smaller company stocks a day after they fell sharply. The Russell 2000 index rebounded 16.67 points, or 1.1%, to 1,472.71.
The market is on track to end the week with a gain after having declined the past four weeks in a row. Still, with two trading days left in August, the major indexes are down more than 3%. If those losses hold, August would be the second monthly drop for the market this year after May.
Uncertainty over the U.S.-China trade conflict and it impact on corporate profits has rattled investors this month. Investors' anxiety has been particularly visible in the demand spike for U.S. government bonds.
When the U.S. yield curve inverted earlier this month for the first time since 2007, it led to a broad market sell-off. This week, investors' reaction has been more muted.
That could be because more traders are factoring in other variables that may be skewing the demand for U.S. bonds that's pulling yields so low. For example, many other countries' long-term bonds now carry negative yields, making U.S. Treasurys more attractive to overseas investors.
"They're coming into the United States and pushing yields down," Krosby said.
This means market watchers trying to gauge the likelihood of a recession should be focusing more on what employment, manufacturing and other key economic data show in coming months, she added.
Recent economic reports have been mixed. The overall economy, as measured by gross domestic product, slowed to an annual growth rate of 2.1% in the April-June quarter from 3.1% in the first quarter. An updated snapshot is due out Friday.
While an inverted yield curve has preceded every recession in the U.S, it's not a signal that a recession is imminent. It's taken anywhere from 14 to 34 months for a recession to begin after past inversions in the yield curve. And in that span of time, the average return for the market has been 15%, said Wills.
"So, if you take your chips off the table now, you could be potentially walking away some great returns," she said, adding that her firm is not calling yet for a recession.
The biggest source of uncertainty for the market and economy is the trade showdown between Washington and Beijing.
U.S. and Chinese trade negotiators are due to meet next month in Washington, but neither side has given any indication of offering concessions to break a deadlock. A round of talks last month in Shanghai ended with no sign of progress.
Investors also pored over a mixed batch of corporate earnings reports and outlooks Wednesday.
Tiffany & Co. gained 3% after the luxury jeweler's second quarter results beat analysts' projections and the company reaffirmed its full-year forecast.
Hewlett Packard Enterprise climbed 3.4% after the information technology products and services provider reported earnings that easily beat analysts' forecasts.
Autodesk slid 6.7% after the software company slashed its full-year forecasts, while Movado Group sank 15% after the watchmaker's earnings and revenue fell short of Wall Street's expectations.
European markets closed broadly lower after British Prime Minister Boris Johnson moved to suspend Parliament, which would hamper lawmakers' efforts to stop a no-deal departure from the European Union in October.
Benchmark crude oil rose 85 cents to settle at $55.78 a barrel after the government reported a higher than expected drawdown in crude inventories. Brent crude oil, the international standard, rose 98 cents to close at $60.49 a barrel.
Wholesale gasoline rose 3 cents to $1.68 per gallon. Heating oil climbed 4 cents to $1.85 per gallon. Natural gas gained 5 cents to $2.25 per 1,000 cubic feet.
Gold slipped $3.20 to $1,537.80 per ounce. Silver rose 16 cents to $18.30 per ounce and copper added a penny to $2.55 per pound.
The dollar rose to 106.03 Japanese yen from 105.78 yen on Tuesday. The euro weakened to $1.1079 from $1.1093.