They were buoyed by news from firms such as retail giant Walmart, which jumped 3% after bucking gloomy retail trends with higher than expected sales.
The S&P 500 rose 0.37% to 2,365.72, while the Dow Jones gained 56.09 points, climbing 0.27% to 20,663.02
The Nasdaq closed at 6,055.13, up 0.73%
The row over the firing of FBI director James Comey, who was leading an investigation into the Trump campaign, has led to growing scepticism about Mr Trump's ability to deliver tax and regulatory reform.
On Wednesday, the S&P 500 and the Dow Jones both recorded their biggest one-day falls since September.
But analysts said stocks were likely over-sold on Wednesday and would rebound.
Optimism was in evidence over at least one of the Trump administration's agenda items: loosening regulations for internet providers.
Those firms currently fall in the same category as public utilities, akin to electricity providers, but the chair of the Federal Communications Commission said he believes that oversight is unnecessarily stringent.
On Thursday, the commission voted to advance a proposal to reverse the Obama administration's 2015 "net neutrality" order.
Verizon shares climbed more than 1%, while Comcast gained 1.5%
Facebook, which slumped 2% on Wednesday, had recovered much of that ground by Thursday morning and bounced further after it announced a deal to livestream 20 baseball games, starting Friday.
The social media giant had previously said it was looking at deals to broadcast sports as it works to beef up its video tab, with the goal of creating a "revenue share" model.
The firm closed the day up 1.94%.
Other firms weighed on the markets.
Shares in Cisco fell more than 7% after it forecast weaker-than-expected quarterly revenues and said it would cut an additional 1,100 jobs.
US stocks recovered some ground on Thursday, after suffering their biggest fall in months amid growing concerns about the Trump presidency.