The Dow Jones industrial average edged down 2.83 points, or 0.02 percent, to close at 17,083.80. It was the fourth-smallest point move in the blue chips this year. The Nasdaq fell 1.59 points, or 0.4 percent, to 4,472.11.

The Standard & Poor's 500 index managed to rise 0.97 of a point, or 0.05 percent, to 1,987.98 — a record, though barely. The day before, the S&P 500 closed at 1,987.01.

Three billion shares changed hands on the New York Stock Exchange Thursday, a quieter-than-average day.

Facebook rose $3.69 to $74.98 after announcing a profit that trounced investors' expectations. The company reported an adjusted profit of 42 cents per share versus the 33 cents analysts were looking for, according to a poll by Zacks Investment Research. Mobile advertising, a crucial business for the world's largest social media company, saw major growth.

"It was a very impressive quarter on top of what we believe were very high Street expectations," said Paul Vogel, an analyst with Barclays Capital, in a note to investors.

Dow member Caterpillar fell $3.34 to $105.04, making it the biggest decliner among the 30 companies that make up the average. The equipment maker's quarterly revenue fell short of forecasts.

Homebuilder stocks slid after the government reported that new home sales sagged 8.1 percent last month. The report also revised down the May sales rate. Shares of Pulte Homes and KB Home fell 3 percent while Toll Brothers fell 4 percent. D.R. Horton quarterly results also dragged down homebuilders. Its profit dropped, and the stock price fell $2.86, or 12 percent, to $21.94.

Another industry that got a lot of attention was autos. Ford rose 6 cents, or 0.3 percent, to $17.84 after reporting a 6 percent increase in second-quarter profit. The automaker was helped by increased sales in Europe. General Motors fell $1.67, or 4.5 percent, to $35.74 after announcing an 85-percent drop in quarterly earnings. The company is in the midst of the worst recall crisis in its history.

Investors got some good news about jobs. The Labor Department reported weekly applications for unemployment aid dropped 19,000 to a seasonally adjusted 284,000 claims. That's the lowest reading since February 2006, nearly two years before the Great Recession began.

In other markets, the yield on the 10-year Treasury note nudged up to 2.51 percent from 2.47 percent late Wednesday. Bond yields rise when prices fall. U.S. crude oil fell $1.05, or 1 percent, to $102.07 a barrel in New York.