Stocks jumped on Tuesday, and the Standard & Poor's 500-stock index had one of its best days of the year as markets put a shaky last couple of weeks further behind them.

Shares of technology companies and retailers helped lead the way. And with markets in a less nervous mood, prices for Treasury bonds, gold and other go-to investments for turbulent times fell.

The S.&P. 500 rose 24.14 points, or 1 percent, to 2,452.51 for its fourth-biggest gain of the year. It took just two days for the index to recoup half the loss it sustained in the two weeks since it set a record on Aug. 7. Those two weeks were a jolt for markets, as worries rose about political strife in Washington and abroad.

The Dow Jones industrial average rose 196.14 points, or 0.9 percent, to 21,899.89 on Tuesday, and the Nasdaq composite gained 84.35, or 1.4 percent, to close at 6,297.48.