The Dow Jones industrial average gained 82.74 points to close at 6,855.80, having briefly dipped into negative territory after surrendering an early 95-point gain. The barometer of 30 big U.S. companies is now less than 30 points from its all-time best close of 6883.90, set Jan. 21.
Advancing issues outnumbered decliners by a 7-to-4 margin on the NYSE, with 1,649 up, 942 down and 772 unchanged. NYSE volume totaled 536.61 million shares, vs. 519.38 million yesterday.
The Standard & Poor's 500-stock index rose 9.41 to 789.56, and the NYSE's composite index climbed 3.91 to 413.80.
The Nasdaq composite index rose 11.29 to 1,357.69, and the American Stock Exchange index climbed 1.58 to 586.61.
Stocks jumped in the morning as bonds rallied, dropping the yield on the 30-year Treasury bond - a key determinant of corporate and consumer borrowing costs - as low as 6.66 percent from late yesterday's 6.75 percent.
But bonds began to pull back in the early afternoon as the dollar sank after U.S. Treasury Secretary Robert Rubin acknowledged some countries have raised concerns over the U.S. currency's strength.
Investors took Rubin's comments as a signal the United States might back off on the past year's successful drive to pull the dollar from its doldrums.
A weaker dollar would make U.S. securities such as bonds less attractive to foreign investors who convert returns to other currencies. As the dollar recovered later in the afternoon, stocks and bonds started to bounce back, with the long-bond yield edging lower to about 6.70 percent.