Energy closed about 0.7 percent higher, giving up earlier gains of more than 1 percent. The sector led advancers in the S&P 500, while financials lagged. Crude oil settled up 53 cents, or 1.15 percent, at $46.59 a barrel.
"There's just a whole lot of uncertainty in markets right now," said Chris Gaffney, president of world markets at EverBank.
We've had "a very good month following a very poor quarter in the third quarter. I think it's some volatility and questioning."
Read MoreSo just how great was October for markets?
The major averages had their best month since October 2011. The S&P 500 closed up 8.3 percent for the month, while the Dow ended nearly 8.5 percent higher for the month. The Nasdaq composite finished October up nearly 9.4 percent.
"You still have very stimulative measures," said Nick Raich, CEO of The Earnings Scout. "You have people who performance chase into the end of the month. It's been a phenomenal October."
He said of the 68 percent of S&P 500 firms that have reported so far, 72 percent have beat earnings estimates but only 43 percent have beat revenue forecasts. That percentage of sales beats is below the 58 percent average, Raich said.
Read MoreStocks could fade after best month in four years
Soft economic data in October encouraged investors' hopes of a delayed U.S. rate hike, while talk of further stimulus from the European Central Bank and a rate cut in China added to a global trend of easy monetary policy.
"Absent central bank intervention, this October rally would have fizzled," Raich said.
Some recovery in oil prices and diminished concerns about negative impact from China slowdown also supported October's gains. The S&P 500 and Nasdaq composite ended the month with gains for the year so far, and the Dow within 1 percent of breaking even for 2015.
"We're now seeing China may be a soft landing, not a hard fall," Gaffney said.
WTI crude closed up 3.33 percent for the month, after hitting its highest level since July of $50.92 a barrel in October.
European stocks ended mixed Friday, under some pressure from weak corporate earnings, but the DAX, CAC and Euro STOXX 600 posted their best month in 6 years.
Japan's Nikkei closed nearly 0.8 percent higher after the Bank of Japan kept monetary policy steady. The index gained 9.75 percent in October for its best month since April 2013.
The Shanghai composite and Hang Seng both ended lower on the day but posted their best month since April this year. The Shanghai composite had its first positive month in five.
Read MoreJanet Yellen just got some pretty bad news
In U.S. economic news, personal income rose 0.1 percent in September, while personal consumption rose 0.1 percent.
The employment cost index rose 0.6 percent in the third quarter.
The Fed's preferred inflation measure, the personal consumption expenditures (PCE) price index, slipped 0.1 percent in September. The decline marked the first drop since January.
PCE "certainly wasn't in the category that gives the Fed confidence that we're really pushing the needle towards strong inflation," said Quincy Krosby, market strategist at Prudential Financial.
Read MoreTepper: THIS could be 'magic formula' for stocks
After the market open, the final read for October consumer sentiment came in at 90.0.
"I don't think there's anything in today's data that moves the needle," said Peter Boockvar, chief market analyst at The Lindsey Group.
He noted that outside the gains in the major U.S. averages for the week and the month, the Shanghai Composite ended nearly 1 percent lower for the week, despite last Friday's rate cut by the People's Bank of China.
In the United States, the Russell 2000 and Dow transports also underperformed the major averages for the week and month.