Wall Street rebounded on Thursday from its biggest selloff in more than eight months with help from a move to loosen internet regulations and strong economic data.
Investors were still watching Washington closely after reports the U.S. President tried to interfere with an investigation into former National Security Adviser Michael Flynn's ties with Russia.
"We could be just shaking off the jitters here. Yesterday, investors were really worried," said Janna Sampson, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.
Investors were likely relieved, she said, by last night's appointment of former FBI chief Robert Mueller to investigate alleged Russian interference in the election and possible collusion between Trump's campaign and Moscow.
"Whatever the (investigation) result, people feel they might have confidence it's an accurate, unbiased result," she said.
The Dow Jones Industrial Average .DJI rose 56.09 points, or 0.27 percent, to 20,663.02, the S&P 500 .SPX gained 8.69 points, or 0.37 percent, to 2,365.72 and the Nasdaq Composite .IXIC added 43.89 points, or 0.73 percent, to 6,055.13.
Investors are monitoring events that could help or hurt Trump's ability to implement proposals such as tax reform and deregulation. At least some of the stock market's post-election rally has been thanks to those proposals.
The Telecommunications Services sector .SPLRCL was the S&P's biggest percentage gainer with a 1.2-percent rise. U.S. telecom regulators voted to advance a Republican plan to reverse a 2015 "net neutrality" order.
"The fact you saw the party in charge have an impact on something might have led people to think, maybe they can get something done," said Sampson.
Earlier in the day the Philadelphia Federal Reserve said business activity index rose in May after declining for two months. Weekly unemployment data also pointed to strength in the labour market.
Indexes briefly pared gains earlier in the day after a speeding car crashed into pedestrians in New York City's Times Square, killing one and injuring 22 people. The incident did not appear to be an act of terrorism, witnesses, police and news media said.
The S&P 500's technology sector .SPLRCT, one of the worst hit on Wednesday, rebounded 0.6 percent.
Cisco (CSCO.O) fell 7.2 percent after the networking gear maker forecast current-quarter revenue below analysts' estimates.
Wal-Mart (WMT.N) rose 3.2 percent at $77.54 after its quarterly earnings beat analysts' expectations.
Advancing issues outnumbered declining ones on the NYSE by a 1.03-to-1 ratio; on Nasdaq, a 1.36-to-1 ratio favoured advancers.
The S&P 500 posted 15 new 52-week highs and 15 new lows; the Nasdaq Composite recorded 47 new highs and 97 new lows.
About 8.16 billion shares changed hands on U.S. exchanges compared with the 6.99 billion average for the last 20 trading sessions.
(Additional reporting by Yashaswini Swamynathan in Bengaluru; Editing by Nick Zieminski)