All three major US Wall Street indexes closed at record highs after posting quarterly and monthly gains.
The positive close came despite investors bracing for a government shutdown that risks delaying key economic reports and affecting the Federal Reserve's (Fed) monetary policy outlook.
With investors betting on the possibility of future Fed interest rate cuts, the benchmark S&P 500, Dow Jones and Nasdaq indexes posted gains for the second consecutive quarter.
The Dow Jones index rose 0.18% to 46,397.89 points, the S&P 500 rose 0.41% to 6,688.46 points, while the technology-focused Nasdaq rose 0.31% to 22,660.01 points.
In other news, President Donald Trump warned Congressional Democrats that a government shutdown at midnight could cause his administration to take 'irreversible' actions, including shutting down their key programs.
While previous shutdowns have had limited impact on markets, some analysts have said this time it risks being more disruptive given the increasingly complex economic backdrop.
The US Department of Transportation announced that if funding runs out at midnight tonight, more than 11,000 Federal Aviation Administration (FAA) employees will be laid off, while 13,000 air traffic controllers will have to work without pay until the shutdown ends.
On Tuesday, the Labor Department reported a slight increase in job openings in August, with hiring and layoffs falling, while US consumer confidence fell more than expected in September.
Fed Vice President Philip Jefferson stressed that the job market could face pressure without central bank support, while Boston Fed President Susan Collins is open to considering further rate cuts.
US stock market volume was $18.56 billion, compared with an average of $18.38 billion over the past 20 trading days.
