U.S. equities closed mostly higher on Thursday as Wall Street digested former FBI Director James Comey's testimony.

The Dow Jones industrial average finished just 8 points higher for the day with Goldman Sachs contributing the most to gains. The average hit an intraday record, soaring more than 80 points midday, following the Comey comments, but gave up most of that increase by the close.

"There were no major bombshells from Comey's testimony," said Lindsey Bell, investment strategist at CFRA, adding the market experienced a small "relief rally" that pushed the 30-stock index to a new high.

The S&P 500 ended marginally higher after nearly hitting a record high of 2,440.23, with utilities leading decliners while a rise in bank stocks capped losses. Bank stocks, some of the early beneficiaries from Trump's election, rose on Thursday, with the SPDR S&P Bank ETF (KBE) jumping more than 2.5 percent. Investors in the space also kept an eye on the House as they prepared to vote on the Financial Choice Act.

"We tested 2,440 on the S&P 500 and we didn't break it," said Jeremy Klein, chief market strategist at FBN Securities. "I think some large-cap traders are just taking some profits."

The Nasdaq composite advanced 0.4 percent and managed intraday and closing record highs.

In his testimony, Comey said he kept records of his conversations with Trump — something he did not do when Barack Obama was president — because he thought Trump might "lie."

"Investors are not spooked by this at all," said Eric Aanes, president and founder of Titus Wealth Management. "The only thing that could be an issue is [potential] delays into tax cuts."

Investors listened closely as they assess how damaging Comey's remarks will be for President Donald Trump and whether he can implement his pro-growth agenda. "That's really what the market cares about," said Robert Pavlik, chief market strategist at Boston Private Wealth.

Expectations for tax reform, deregulation and infrastructure spending were a key catalyst for stocks after Trump's election. But uncertainty about the implementation of those measures has grown with time as the Trump administration is forced to put out one fire after another.