Stocks closed with tiny gains on Wall Street Friday that were enough to nudge the S&P 500 index and Nasdaq to all-time highs for the second straight day.

Investors weighed the news that the U.S. and China have reached an initial deal in their long-running trade war. The pact means the U.S. won’t impose new tariffs on Chinese goods that had been set to kick in this weekend. Technology companies, which do a lot of business with China, led the gainers.

On Friday:

The S&P 500 index rose 0.23 points, or less than 0.1%, to 3,168.80, a record.

The Dow Jones Industrial Average inched up 3.33 points, or less than 0.1%, to 28,135.38.

The Nasdaq gained 17.56 points, or 0.2%, to 8,734.88, a record.

The Russell 2000 index of smaller company stocks fell 6.84 points, or 0.4%, to 1,637.98.

For the week:

The S&P 500 rose 22.89 points, or 0.7%.

The Dow gained 120.32 points, or 0.4%.

The Nasdaq added 78.35 points, or 0.9%.

The Russell 2000 picked up 4.14 points, or 0.3%.

For the year:

The S&P 500 is up 661.95 points, or 26.4%.

The Dow is up 4,807.92 points, or 20.6%.

The Nasdaq is up 2,099.60 points, or 31.6%.

The Russell 2000 is up 289.42 points, or 21.5%.