Mega-cap stocks jumped with Apple Inc up 0.9% and Amazon.com Inc rising 1.2%, the biggest boosts to the S&P 500 and Nasdaq. Tesla and Google-parent Alphabet both rose more than 1%.
The U.S. Senate took a step toward passing a $480 billion increase in Treasury Department borrowing authority, which would put off another partisan showdown until December.
Uncertainty over the debt-ceiling negotiations was one concern investors cited in September as the S&P 500 logged its biggest monthly percentage drop since the onset of the coronavirus pandemic in March 2020.
"Today's (market) is driven by a slight move in Washington towards rationality about being able to pay their bills, write some checks," said Kim Forrest, chief investment officer at Bokeh Capital Partners in Pittsburgh.
Meanwhile, data showed the number of Americans filing new claims for jobless benefits dropped last week by the most in three months, suggesting the labor market recovery was regaining momentum as the latest wave of COVID-19 infections began to subside.
The closely watched monthly U.S. jobs report is due on Friday.
"Today's numbers reinforce the expectation that employment will take a significant step up in the coming months, and I think that's positive for the economy," said Brad Neuman, director of market strategy at Alger.
"The market climbed its wall of worry today as fears of a debt-ceiling impasse receded and hopes for an acceleration in employment gains were reinforced."
The Dow Jones Industrial Average rose 0.98% to end at 34,754.94 points, while the S&P 500 gained 0.83% to 4,399.76.
The Nasdaq Composite climbed 1.05% to 14,654.02.
The S&P 500 materials index jumped 1.35% and the consumer discretionary index rallied 1.50%, both leading among 11 sectors.
U.S.-traded Chinese stocks Alibaba Group Holding and Tencent Holdings each surged about 8% as concerns around U.S.-Sino trade relations and Evergrande's debt crisis appeared to ease.
Investors will watch third-quarter earnings reports that start to arrive in earnest next week. Analysts on average estimate S&P 500 companies' earnings per share rose 29% in the third quarter, according to Refinitiv.
Levi Strauss & Co shares jumped 8.5% after the jeans maker beat third-quarter revenue and profit estimates.
Volume on U.S. exchanges was 10.1 billion shares, compared with the 11 billion average over the last 20 trading days.
Advancing issues outnumbered declining ones on the NYSE by a 2.50-to-1 ratio; on Nasdaq, a 2.49-to-1 ratio favored advancers.
The S&P 500 posted 31 new 52-week highs and four new lows; the Nasdaq Composite recorded 93 new highs and 80 new lows.
(Reporting by Lewis Krauskopf in New York, Shreyashi Sanyal and Devik Jain in Bengaluru; additional reporting by Noel Randewich; Editing by Saumyadeb Chakrabarty, Maju Samuel and David Gregorio)
By Noel Randewich, Lewis Krauskopf and Devik Jain