The three main indexes hit record intraday highs on Friday, continuing a strong run for the week on hopes of an interest rate cut this month, while investors waited for the start of the corporate earnings season next week.
In his two-day testimony before Congress, Federal Reserve Chairman Jerome Powell said the U.S. economy was still under threat from disappointing factory activity, tame inflation and a simmering trade war and that the central bank stood ready to "act as appropriate".
"My belief on why the Fed will likely lower rates in the July meeting is that it will try to assume its responsibilities as the central bank for the world, and global economic indicators are not as healthy as in the U.S.," said James Abate, chief investment officer at Centre Asset Management in New York.
Abate said most of the positive catalysts that have driven the market higher have been priced in and now the focus will shift to the earnings season.
Corporate profits are expected to take a hit from U.S.-China trade tensions, with S&P 500 companies expected to report a 0.4% dip in second-quarter earnings, according to Refinitiv IBES data.
Results from two major U.S. railroads next week will also be closely watched for signs of how the trade war is affecting freight companies and the wider economy.
The S&P 500 traded above the 3,000 level for a third straight session, also boosted by a 0.63% gain in the technology sector, the S&P 500's best performer so far this year.
The healthcare sector fell 1.70%, the most among the 11 major S&P sectors, weighed down by a 4% slide in shares of Johnson & Johnson.
The U.S. Justice Department is pursuing a criminal probe into whether the healthcare conglomerate lied about potential cancer risks of its talcum powder, Bloomberg reported, citing people with knowledge of the matter.
The Dow Jones Industrial Average was up 157.23 points, or 0.58 percent, at 27,245.31 and the S&P 500 was up 6.24 points, or 0.21 percent, at 3,006.15.
The Nasdaq Composite was up 32.70 points, or 0.40 percent, at 8,228.74.
Data showed U.S. producer prices rose slightly in June, leading to the smallest annual increase in producer inflation in nearly 2-1/2 years and also showed a slowdown in underlying producer prices last month, suggesting that overall inflation could remain moderate for a while.
Keeping investors on edge was Beijing's threat to impose sanctions on U.S. firms that sell arms to Taiwan after Washington approved possible sales of $2.2 billion in tanks, missiles and related equipment.
Illumina Inc tumbled 15.61%, the most among S&P 500 companies, after the gene sequencing company's preliminary second-quarter revenue came in below analysts' estimates.
Ford Motor Co gained 2.65% after the automaker and Volkswagen AG joined forces to develop autonomous and electric cars.
Advancing issues outnumbered decliners by a 1.66-to-1 ratio on the NYSE and by a 1.59-to-1 ratio on the Nasdaq.
The S&P index recorded 42 new 52-week highs and two new lows, while the Nasdaq recorded 68 new highs and 34 new lows.