After spending most of Friday flat or down, stocks rallied at the last minute and closed slightly higher, just enough to post new record highs for the Dow Jones industrial average and the Standard & Poor's 500 index.
The S&P 500 has closed higher seven days in a row. The last time it did that was in March.
Investors had to look past a pessimistic outlook from UPS, which said it was seeing a slowdown in U.S. industry. And in the afternoon, Boeing shares tanked after one of its 787s caught on fire in London, reviving fears of the troubles that plane had with smoldering batteries earlier this year.