(AP) -- Major U.S. stock indexes ended essentially flat Friday after a day of mostly listless trading. Even so, the S&P 500 closed out the week with its fifth straight weekly gain.
The benchmark index squeaked out a tiny gain that was good enough for its 35th record high this year. The Dow Jones Industrial Average also notched a slight gain, giving it its 22nd all-time high of 2019. The Nasdaq composite closed with a modest loss, snapping the index's 11-day winning streak.
Investors drove up shares of stocks in defensive sectors, including household goods makers, real estate companies and utilities. Those gains were checked by losses in energy, financial and communication services stocks. Bond yields fell.
With two days of trading left in 2019, the market is on track for its best year since 2013.
"Some of the selling today is just profit-taking," said Ben Phillips, chief investment officer at EventShares. "People are just maybe checking out for the rest of the year and taking some profits on positions because there are a lot of things that are up meaningfully."
The S&P 500 inched up 0.11 points, or less than 0.1%, to 3,240.02. The index has finished with a weekly gain 11 out of the past 12 weeks.
The Dow rose 23.87 points, or 0.1%, to 28,645.26. The Nasdaq composite slipped 15.77 points, or 0.2%, to 9,006.62.
Smaller company stocks took the brunt of the selling. The Russell 2000 index fell 8.64 points, or 0.5%, to 1,669.03. More stocks declined than rose on the New York Stock Exchange.
Bond prices rose. The 10-year Treasury yield fell to 1.87% from 1.90% late Thursday.
A truce in the 17-month U.S.-China trade war and positive signs for the economy have helped keep investors in a buying mood. Fears about a possible recession have also faded since the summer after the Federal Reserve cut interest rates three times and signaled that it will keep them low for a long time.
Still, as the market prepares to close out a strong year of gains next week, uncertainty remains over the final details of the "Phase 1" trade deal and whether Washington and Beijing will be able to resolve remaining differences not addressed by the initial pact. The U.S. presidential election could also drive volatility in the markets next year.
"If the trade deal really gets done, that's improvement in sentiment, which drives markets and CEO confidence, and then you still have very easy money out there and the Fed doesn't plan on changing that," Phillips said. "All those things combined suggest that equities should rise in the next 12 months, though maybe not as strong as 2019."
Trading volume remained lighter than usual Friday. General Mills was among the biggest gainers in the S&P 500 as traders shifted assets into traditionally defensive sector stocks. The consumer foods company rose 1.5%.
Investors also favored real estate and utilities stocks. Kimco Realty gained 1.5% and American Water Works rose 0.9%.
Several airlines fell. American Airlines Group was the biggest decliner in the S&P 500, shedding 4.2%. Southwest Airlines and Alaska Air Group lost 1.1%.
Devon Energy led a slide in energy sector stocks, shedding 2.4%.
Investors bid up shares in Michaels Cos. after the arts and crafts retailer hired an executive from Walmart to be CEO. The stock vaulted 32.9%.
Oil prices rebounded from an early stumble. Benchmark U.S. crude rose 1 cent to settle at $61.72 per barrel. Brent crude, used to price international oils, gained 24 cents to close at $68.16 per barrel.
In other commodities trading, wholesale gasoline fell 1 cent to $1.74 per gallon. Heating oil was little changed at $2.05 per gallon. Natural gas slid 14 cents, or 5.9%, to $2.16 per 1,000 cubic feet.
The price of gold rose $3.70 to $1,518.10 per ounce. Silver fell 5 cents to $17.94 per ounce. Copper dropped 2 cents to $2.83 per pound.
The dollar fell to 109.40 Japanese yen from 109.65 yen on Thursday. The euro strengthened to $1.1186 from $1.1102.
European markets closed mostly higher. Earlier in Asia, Hong Kong finished with gains and Tokyo declined.