The closed at a record Friday, helped by gains in technology stocks on the last trading day of the quarter.
The tech-heavy Nasdaq composite rose more than half a percent to post its 50th record close for this year. The Dow transports and small-cap Russell 2000 also hit record highs.
The index posted quarterly gains of 4.9 percent its eighth straight quarter of gains for the first time since 1997.
The S&P 500 rose nearly 4 percent in the quarter, also its eighth straight quarter of gains. The Nasdaq composite gained almost 5.8 percent for the quarter, its fifth straight positive quarter since 2015.
Information technology was the best performing stock sector in the S&P in the third quarter, up 8.3 percent in a fifth-straight quarter of gains. Consumer staples was the only sector to fall in the third quarter.
The S&P and Dow rose about 2 percent in September, while the Nasdaq gained about 1 percent for the month.
"The SPX has broken out of its consolidation phase, generating a bullish "pop" in the daily stochastics," BTIG Chief Technical Strategist Katie Stockton said in a Friday morning note. "This supports near-term positive follow-through, and suggests it will take at least a couple of weeks before 'overly bullish' sentiment gives way to a pullback."
"Importantly, the Russell 2000 Index has confirmed a breakout above final resistance at its July high, reflecting the expanding breadth behind the rally," she said.
Several major biotech stocks fell after the U.S. Food and Drug Administration made it easier for the public to search for drug side effects through a database.
The CBOE Volatility Index (.VIX), widely considered the best gauge of fear in the market, traded lower near 9.5.
The average daily range for the S&P 500 this month was 0.4 percent, the least volatile September on record, according to Ryan Detrick, senior market strategist, LPL Financial.
Meanwhile, trading volume has fallen. Tabb Group data showed average daily volume in September of 6.3 billion marked an 11 percent decline from the prior year.
October is setting up to be a good month for stocks, according to the Stock Trader's Almanac.
In years following a presidential election, the Dow Jones industrial average has been up 11 times with an average gain of 0.7 percent, the almanac said, citing 17 years. But the almanac also warned that in the last three such years ending in "7," October was when the stock market plunged: 2007, 1997 and 1987.
The S&P and small-cap Russell 2000 index closed at a record Thursday after the release of the GOP's highly anticipated tax reform framework Wednesday.
"The tax framework, I think, it's a lot of noise. Very few specifics for markets and investors to make decisions on," said Craig Bishop, lead strategist, U.S. Fixed Income Strategies Group at RBC Wealth Management. The proposal's release does mark an "opening salvo for discussions to begin," Bishop said.
However, the Republican party has struggled to repeal and replace the Affordable Care Act this year despite having a majority in Congress. The tax framework released this week also contains some highly debatable proposals such as while reducing the rate on wealthy individuals, contrary to what polls show Americans prefer.
In economic news, the Federal Reserve's preferred measure of inflation posted its slowest pace of annual increase since November 2015. The personal consumption expenditures index, excluding food and energy, rose 1.3 percent in the 12 months through August, according to the Department of Commerce.
The Chicago PMI unexpectedly rose to 65.2 in September. The final read on consumer sentiment from the University of Michigan showed a slight decline from to 95.1 in September from 96.8 in August.
Treasury yields rose after the PMI report and after news former Federal Reserve Governor Kevin Warsh met with President Donald Trump and Treasury Secretary Steven Mnuchin Thursday. It's not yet clear what they discussed, but The Wall Street Journal, citing a White House source, said the meeting was to discuss the job of heading the Federal Reserve. Fed Chair Janet Yellen's term expires in February.
"Warsh is believed to be on the more hawkish side," said Thierry Albert Wizman, global interest rates and currencies strategist at Macquarie.
Later Friday afternoon, The Wall Street Journal, citing a White House source, said Trump has also spoken to Governor Jerome "Jay" Powell for the Fed chair position.
"If anyone other than Yellen [gets appointed] he's probably going to have more of a deregulatory impulse," said Eric Stein, co-director of global fixed income at Eaton Vance Management.
The traded near 1.48 percent, around nine-year highs hit earlier in the week. The yield climbed amid hopes of tax relief and after encouraging reports on business spending and Fed Chair Janet Yellen's remarks that indicated the Fed will maintain a gradual pace of monetary policy tightening.
The traded near 2.33 percent, near its highest since July 13.
The U.S. dollar index traded near 93.06 after hitting Thursday its highest since August 18. The index is still more than 2.5 percent lower for the third quarter, tracking for its third-straight quarterly loss since 2008.
The euro weakened after hitting $1.1803, its highest against the dollar since September 26.
U.S. crude oil futures settled slightly higher at $51.67 a barrel after the weekly oil rig count rose by 6 rigs to 750. Oil rose 12 percent in the third quarter, its best in more than a year.
Gold futures for December delivery fell $3.90 to settle at $1,284.80 an ounce. Gold fell 2.8 percent in September for its worst month since November.
The German DAX gained 4 percent for the quarter for its first five-quarter win streak since 2014.
The iShares MSCI Emerging Markets ETF (EEM) closed up 1.2 percent, its first positive day in eight. EEM gained 8.3 percent for the quarter.
Global stock markets have climbed as underlying economic growth around the world has been solid.
It's the "synchronized global recovery," Ben Pace, chief investment officer at HPM Partners, said of stock markets' run higher. "I don't think there's any meaningful economy in the world that's in recession right now."