The U.S. stock market eked out a slight gain on Tuesday, helped by a surge in shares of technology companies and airlines.

The Dow Jones industrial average climbed 3.66 points, less than 0.1 percent, to close at 17,515.23.

The Standard & Poor's 500 index rose 3.13 points, or 0.2 percent, to finish at 2,022.55.

The Nasdaq composite rose 20.46 points, or 0.4 percent, to 4,654.85.

For the year:

The Dow is down 307.84 points, or 1.7 percent.

The S&P 500 is down 36.35 points, or 1.8 percent.

The Nasdaq is down 81.21 points, or 1.7 percent.