U.S. stocks closed higher Thursday, with the Dow and S&P above key psychological levels, as investors digested the Federal Reserve's September meeting minutes.
"I think the combination of oil (gains) and the Fed minutes have lifted the indices here," said Peter Cardillo, chief market economist at Rockwell Global Capital, noting the minutes diminished the likelihood of a rate hike this year.
The Dow Jones industrial average and S&P 500 opened lower and attempted slight gains, before rallying after the release of the Fed minutes to close above their 50-day moving averages. The Dow also ended above its 50-day on Wednesday.
The Dow ended 138 points higher to close above 17,000 for the first time since Aug. 19. Earlier, the index gained more than 150 points, holding above 17,000 in intraday trade for the first time since Aug. 20. IBM and Nike contributed the most to gains and Apple was the greatest negative weight.
The Nasdaq composite recovered losses after the Fed minutes to close about 0.4 percent higher. The index remained below its 50-day moving average, underperforming the other major indexes as Apple closed down about 1.2 percent. The iShares Nasdaq Biotechnology ETF (IBB) closed down 0.2 percent after falling more than 3 percent.
The S&P gained nearly 0.9 percent to close above the psychologically key level of 2,000 for the first time since Aug. 20. The index briefly dipped into negative territory in choppy trade following the minutes' release.
The last time the S&P topped 2,000 in intraday trade was on Sept. 17, when the Fed released its statement.
Energy closed up about 1.9 percent to lead all 10 sectors higher. Crude oil futures hit $50 a barrel for the first time since July before settling up 3.4 percent at $49.43 a barrel.
Treasury yields held higher in the close, with the 10-year at 2.10 percent and the 2-year higher at 0.63 percent.
Earlier, the Treasury Department auctioned $13 billion of 30-year bonds at a high yield of 2.914 percent.
The U.S. dollar traded lower against major world currencies, with the euro briefly topping $1.13 and the yen at 119.93 yen against the greenback.
The September meeting indicated that policymakers were still watching inflation and the impact of slower global growth.
"I think you got a little more clarity on what the Fed was thinking. The decision to not raise rates was more collaborative than people thought. The call really wasn't that close," said Peter Coleman, head trader at Convergex. He added the minutes showed the Fed was concerned about not reaching its inflation target in the near term.
"Participants anticipated that recent global developments would likely put further downward pressure on inflation in the near term; compared with their previous forecasts, more now saw the risks to inflation as tilted to the downside," the September minutes said. "But participants still expected that, as the labor market continued to improve and the transitory effects of declines in energy and non-oil import prices dissipated, inflation would rise gradually toward 2 percent over the medium term."
Many market analysts expected the U.S. central bank to raise short-term interest rates for the first time in nearly a decade at its September meeting. The Fed's decision to hold off on a hike caused great uncertainty in markets about policymakers' views on domestic and global economic conditions.
Since the Fed meeting was held on Sept. 16 and 17, the minutes didn't reflect the central bank's view on last Friday's weaker-than-expected nonfarm payrolls report. The data pushed out expectations on the timing of the first rate hike. After the release of the minutes, Fed funds futures continued to price the initial rate increase in March 2016 at the earliest.
"The (minutes) didn't give the market any clarity on when liftoff would occur and markets were hoping for more guidance," said Myles Clouston, senior director at Nasdaq.
Investors also eyed the surprising news that House Majority Leader Kevin McCarthy has withdrawn from the race for House Speaker, adding to concerns on Congress' ability to smoothly resolve crucial budget negotiations.
"Obviously we need someone to be speaker of the House and no one's raising their hand," said Art Hogan, chief market strategist at Wunderlich Securities. "If it's hard to elect a speaker of the House it's going to be that hard to get something passed."
Other analysts remained confident Congress would reach a deal on the debt ceiling.
In a light day of economic reports, weekly jobless claims declined to 263,000, a near 42-year low.
Read MoreThe problem with my $70 oil call
In Europe, the pan-European Stoxx 600 index closed mildly higher. In Asia, Japan's Nikkei finished 0.99 percent lower. Mainland Chinese markets reopened after a week-long holiday, with the Shanghai Composite closing 3.0 percent higher.
U.S. stocks closed higher Wednesday, helped by a recovery in health care stocks and gains in energy, as investors awaited the beginning of earnings season.
"We saw the market rally sharply last week off a very significant level of support at the August low," said Adam Sarhan, CEO of Sarhan Capital. He noted resistance around the 50-day moving averages.
"The bears are still in control because we're still under levels of support and below the (key) moving averages," he said of morning trade.
The Dow transports closed up 1.38 percent, above its 50-day moving average.
The closed up 17.6 points, or 0.88 percent, at 2,013.43, with energy leading all 10 sectors higher.
The Nasdaq traded up 25 points, or 0.53 percent, at 4,816.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded below 18.
About four stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of 605 million and a composite volume of nearly 3 billion in afternoon trade.
Gold futures settled down $4.40 at $1,144.30 an ounce.
Correction: An earlier version misstated the length of time since the previous record on weekly jobless claims. It was 42 years.
On tap this week:
Earnings: Alcoa, Ruby Tuesday
4:30 p.m.: Fed Balance Sheet/Money Supply
8:30 a.m.: Import prices
10 a.m.: Wholesale trade
11 a.m.: New York Fed President's William Dudley speaks
1 p.m.: Baker-Hughes Rig Count
1:30 p.m.: Chicago Fed President's Charles Evans speaks
More from CNBC.com: