By Anora Mahmudova and Barbara Kollmeyer, MarketWatch

NEW YORK (MarketWatch) -- The S&P 500 closed at an all-time high for the 27th time this year on Thursday, but other U.S. stock-market benchmarks slipped back into the red just ahead of the closing bell.

The main benchmarks traded in a narrow range throughout the session as investors processed a deluge of earnings reports and mixed economic data.

The S&P 500 (SPX) closed less than a point higher at 1,987.98, after setting a fresh intraday record. The Dow Jones Industrial Average (DJI) finished off 2.83 points at 17,083.80. The Nasdaq Composite (RIXF) ended the day 1.59 points lower at 4,472.11.

Read the recap of MarketWatch's live blog of today's stock-market action.

Colin Cieszynski, chief market strategist at CMC Markets, says markets have had a pretty good run, which make them vulnerable for corrections.

"Markets are already at lofty levels and we need more good news to keep going higher," he said. "Today's economic and corporate news have been mixed. Earnings so far have supported the market, but there is cautious optimism among investors as we are entering historically weak months."

Shares of Facebook(FB) jumped 5.2% action after its profit and sales beat expectations.

Ford(F) shares rose 0.3% after the car maker beat earnings expectations.

General Motors Co. (GM.XX) profit sank 80% as the auto maker was hit by recalls. Adjusted earnings matched analyst expectations. Shares fell 4.5%.

Among the decliners, TripAdvisor Inc. (TRIP) sank 5.2% and Angie's List Inc. (ANGI) tumbled 19% after those companies separately reported late Wednesday.

Caterpillar Inc. (CAT) shares dropped 3.1% after the maker of manufacturing equipment said sales fell short of expectations in the second quarter, but the company raised its earnings outlook again.

For more on Thursday's notable movers, read our Mover & Shakers column.

Among economic news, the number of people filing for unemployment benefits fell to the lowest level since February 2006, surprising economists, but June's pace of new-home sales hit a three-month low and the May rate was revised down significantly.

Outside of a loss for the Nikkei 225 index , Asian stocks rose across the board Thursday with a 1.2% gain for the China Shanghai Composite , after a preliminary reading of Chinese manufacturing data from HSBC hit an 18-month high. European stocks gained across the board amid a big earnings day there.

Crude-oil (CLU4) edged lower along with gold prices (GCQ4), while the dollar (DXY) steadied.

More must-reads from MarketWatch:

Why the S&P rally is nothing to get freaked out about, in one graph

EU set to ban trading in Russian stocks: FT

Goldman's 'golden cross' appears at the perfect time

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

Angi (NASDAQ:ANGI)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Angi Charts.
Angi (NASDAQ:ANGI)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Angi Charts.