Stocks closed out their best year since 2013 with the S&P 500 index gaining 28.9% in 2019, led by huge gains in technology companies and more in Tuesday’s Stock Market Update.

Major indexes ended slightly higher Tuesday after spending most of the day wavering between small gains and losses. Technology and health care stocks led the gainers.

The market’s trajectory to a strong finish for the year began in October as stocks emerged from a late-summer slump caused by fears that the U.S. economy could be headed for a recession. Those concerns eased as investors drew encouragement from surprisingly good third-quarter corporate earnings, a third interest rate cut by the Federal Reserve and other data showing the economy was not slowing as much as economists had feared.

A truce in the 17-month U.S.-China trade war helped keep investors in a buying mood through the end of the year. Washington and Beijing announced in December they reached an agreement over a “Phase 1” trade deal that calls for the U.S. to reduce tariffs and China to buy larger quantities of U.S. farm products.

On Tuesday, President Donald Trump tweeted that he will sign the initial trade deal with China at the White House next month. He also said he plans to travel to Beijing at a later date to open talks on other sticking points in the U.S.-China trade relationship that remain to be worked out, including Chinese practices the U.S. complains unfairly favor its own companies.

STOCK MARKET UPDATE

KEEPING SCORE: The S&P 500 finished 2019 up 9 points, or 0.3%, to 3,230. The Dow Jones Industrial Average gained 74 points, or 0.2%, to finish the year at 28,536. The Nasdaq composite rose 26 points, or 0.2%, to 8,972.

Smaller company stocks fared better than the rest of the market, sending the Russell 2000 index 0.2% higher. The Russell ended the year with around a 24% gain.

U.S. markets are closed on New Year’s Day on Wednesday. They re-open Thursday.

GOING TO COURT? Shares in McDermott International slumped 9.8% after The Wall Street Journal reported that the engineering company is considering filing for bankruptcy.

CALL THE DOCTOR: Health care sector stocks accounted for a big slice of the selling Tuesday, with shares in several health insurers moving lower. Anthem slid 1% Humana dropped 0.3%.

BOND YIELDS: Bond prices fell. The yield on the 10-year Treasury note rose to 1.91% from 1.89% late Thursday.

MILESTONES APLENTY: The S&P 500 has set record highs 35 times this year, up from 19 last year. The benchmark index closed above 3,000 points for the first time in September.

The Dow, which climbed above the 28,000 mark for the first time in November, has set 22 record highs this year, eclipsing the 15 it set in 2018.

The Nasdaq, which closed above 9,000 for the first time in late December, has marked 31 new highs this year, beating last year’s 16 times.

TECH’S BIG YEAR: Technology stocks have helped power the broader market’s gains this year. Tech finished 2019 with a gain of around 47.5%, well ahead of the other 10 sectors in the S&P 500.

BANKING ON BANKS: Financial sector stocks, especially big banks, posted strong gains in 2019, despite a sharp pullback in interest rates.

The sector is up around 29% for the year, while JPMorgan Chase, Bank of America and Citigroup are each up over 40%.

COMMODITIES: Benchmark U.S. crude oil was up $0.07 to $61.13 per barrel as of 4:07 p.m EST. Brent crude, the international standard, was up $0.13 to $66.13 per barrel around the same time.

The price of gold rose $8.29 to $1,517.59 per ounce around 4:09 p.m. on the East Coast.

MARKETS OVERSEAS: Britain’s FTSE 100 slipped 0.6%, while the CAC 40 in Paris shed 0.1%. Germany’s markets were closed. In Asia, Hong Kong’s Hang Seng index lost 0.5%, while in Australia the S&P ASX 200 declined 1.7%. Many markets, including those in Tokyo and Seoul, have already ended trading for 2019.

© The Associated Press. All rights reserved.