Solid gains among phone companies and some retailers helped nudge US stocks higher on Thursday, a day after the stock market had its biggest drop in eight months.
Banks also recouped some of their losses. Energy and materials stocks fell.
The rally came a day after the market's worst drop since September as political tumult deepened in Washington, stoking worries among investors that President Donald Trump may have trouble enacting tax cuts and other business-friendly policies.
"People may be wanting to put money to work in stocks, but the bonds they bought yesterday, they're still going to keep those as a little bit of a hedge, just in case," said JJ Kinahan, chief market strategist at TD Ameritrade.
The Standard & Poor's 500 index rose 8.69 points, or 0.4%, to 2,365.72.
The Dow Jones industrial average added 56.09 points, or 0.3%, to 20,663.02.
The Nasdaq composite index gained 43.89 points, or 0.7%, to 6,055.13.
The Russell 2000 index of smaller stocks picked up 5.19 points, or 0.4%, to 1,361.08.
Bond prices slipped. The 10-year Treasury yield rose to 2.23% from 2.22%.
Despite the day's gains, the major stock indexes were still on course to end the week in the red.
Stocks appeared headed for another down day early Thursday following sell-offs in Asia and Europe.
But better-than-expected quarterly results from Wal-Mart Stores and retailers such as L Brands helped lift the market.
Wal-Mart gained 2.42 dollars, or 3.2%, to 77.54 dollars, while L Brands rose 1.29 dollars, or 2.7%, to 49.69 dollars.
Traders also welcomed data from the Labor Department showing that applications for unemployment benefits fell last week to the lowest level in nearly three months.
Among other big movers: Incyte surged 6.9% on growing analyst optimism over the biopharmaceutical company's work developing cancer treatments. The stock gained 8.31 dollars to 128.80 dollars.
Weak quarterly results from other companies sent those stocks lower.
Ascena Retail Group sank 27% after the retailer cut its forecast for its fiscal third quarter and full year, citing lagging customer traffic and other challenges. The stock lost 76 cents to 2.06 dollars.
Cisco Systems fell 7.2% a day after the internet gear maker said it expects revenue in its fiscal third quarter to be down from a year earlier.
The company also said it was laying off 1,100 workers in addition to the 5,500 job cuts Cisco announced last August. The stock gave up 2.44 dollars to 31.38 dollars.