Bond prices reversed early losses and advanced, sending yields lower, following an improvement in the April trade deficit which boosted the dollar.
The yield of the benchmark 10-year Treasury bond backed off an overnight high of 5.25%, helping to take some pressure off of stocks.
"We've been tracking the bond market over the last couple of days," said Kevin Kruszenski, head of trading at KeyBanc Capital. "The selling [in bonds] got overdone and buyers like a yield north of 5%," he said.
The Dow Jones Industrial Average gained 33 points to 13,300, as 20 of its 30 stocks advanced.
Among blue chips, McDonald's Corp. led the gains, rising 2.2% after saying global same-restaurant sales rose 8.7% in May.
The S&P 500 index advanced 3.6 points to 1,494, and the Nasdaq Composite rose 11.2 points to 2,552.
Tech shares receive a lift from the chip sector. National Semiconductor jumped 11.2% after the company posted a smaller-than-expected drop in profit and said it was buying back $2 billion worth of shares. UBS upgraded the stock to buy from neutral.
Trading volumes showed 215 million shares exchanging hands on the New York Stock Exchange and 288 million trading on the Nasdaq stock market. Declining shares outpaced gainers by 15 to 14 on the NYSE, while gainers topped decliners by 13 to 11 on the Nasdaq.
After dropping nearly 200 points on Thursday, the Dow industrials' losses amounted to 410 points over the past three sessions.
"The major market averages have now pulled back about 3% and are entering that target range for a typical summertime pullback of between 3% and 5%," said Marc Pado, market strategist at Cantor Fitzgerald.
"Obviously, the rocketing bond yields are disconcerting, but we are only now reaching technical support," he said. "It is possible that, once we digest the global market reaction to our selloff, we could see an attempt at a little Friday bounce."
In recent action, the benchmark 10-year Treasury bond was up 3/32 at 95 6/32, yielding 5.124%. It earlier rose to a high of 5.25%.
The bond market was under pressure over night.
News that the U.S. trade deficit narrowed by 6.2% in April to $58.5 billion helped boost the dollar, which in turn keeps U.S. assets such as stocks and bonds attractive for overseas investors.
This was the largest improvement in the trade gap since last October. The trade deficit was below the consensus forecast of Wall Street economists of a deficit of $63.5 billion.
The improvement in the deficit should boost second quarter gross domestic product, although there remains two months of trade data to assess for the second quarter.
The dollar rose sharply against the euro and the yen.
Crude oil futures dropped 70 cents to $66.23 a barrel.
Gold futures fell $5.30 to $657.0 an ounce.
By Nick Godt