The Dow Jones industrial average, meanwhile, ended Thursday's session within half a percent away from its record high, rising 70 points, with UnitedHealth and 3M contributing the most gains.

The Nasdaq composite also recorded all-time highs on an intraday and closing basis as Netflix, Alphabet, and Facebook shares all rose. Amazon also climbed, nearing the $1,000 per-share mark.

The S&P 500 posted a record close and notched a new all-time intraday high. Information technology was among the best-performing sectors, rising 0.8 percent. Tech has been on a tear this year, surging more than 19 percent.

U.S. stocks closed higher on Thursday as tech stocks climbed while Wall Street remained positive about the Federal Reserve's plan to trim its balance sheet.

Traders work on the floor of the New York Stock Exchange.

According to the minutes from its May 3 meeting, which were released Wednesday, the Fed sees a system where it will announce cap limits on how much it will allow to roll off each month without reinvesting.

"The markets are taking the Fed's comments on how they plan to unwind the balance sheet as a positive," said Robert Pavlik, chief market strategist at Boston Private Wealth.

Pavlik also noted that the S&P closed decisively above 2,400 on Wednesday, a key technical level, that could prompt more investors to jump into the market.

Katie Stockton, chief technical strategist at BTIG, said: "Short-term upside is likely greatest for small- and mid-cap stocks given their relatively oversold position."

Equities came into Thursday's session riding a five-day winning streak, wiping out losses from last week's sell-off as investors shrug off negative news from Washington.

"Investors have been focusing on strong earnings and improving fundamentals rather than political noise," said Brent Schutte, chief investment strategist for Northwestern Mutual Wealth Management. "Now people are wondering what to worry about next.

Wall Street also kept an eye on oil prices after OPEC agreed to extend production cuts by nine months. That disappointed some investors, who had hoped that OPEC might reduce output even further to drain a global glut that has depressed markets for almost three years.

U.S. crude for July delivery fell on the back of the news, falling nearly 5 percent to settle at $48.90 per barrel.

"I think it was a buy-the-rumor-sell-the-news event," said Tamar Essner, energy analyst at Nasdaq. "There was also some hope that the cuts would deepen a bit."

In economic news, jobless claims hit 234,000 last week, rising slightly from the previous week, but remained near their lowest levels in more than 40 years.

U.S. Treasurys rose on Thursday, with the benchmark 10-year yield slipping to 2.253 percent and the short-term two-year note yield declining to 1.293 percent.