NEW YORK — A run of record highs in the stock market came to an end Tuesday as the Standard & Poor’s 500 index lost ground for just the second time this month.

The slight loss for the index broke a four-day string of all-time highs.

Shares of RadioShack sank after the retailer’s losses deepened, and MetLife rose after the insurer announced a plan to buy back its own stock.

The Standard & Poor’s 500 index slipped 0.48 of a point, or 0.02 percent, to close at 1,950.79 on a quiet day for trading. The most widely used benchmark for mutual funds closed at an all-time high on Monday, its fourth record high in a row.

Six industry groups in the S&P 500 fell and four rose Tuesday, though none moved by more than 0.3 percent.

The Dow Jones industrial average rose 2.82 points, or 0.02 percent, to 16,945.92, a new high, while the Nasdaq picked up 1.75 points, or 0.04 percent, to 4,338.

After slumping earlier this year, the stock market has been on a slow and steady climb since April. In recent weeks, a number of encouraging economic reports have helped push the S&P 500 to a series of record highs and left the index up 5.5 percent for the year. Some analysts argue that this success rests on shaky ground.

“I’ve never seen a rally that has been so hated and mistrusted before,” said Dan Veru, chief investment officer at Palisade Capital Management. “People ask me, ‘Why is the stock market up? When should I bail out before the next crash?'”

Veru said one reason for the mistrust is that most people don’t feel like the economy is strong enough.

Before the market opened Tuesday, RadioShack posted a deeper quarterly loss than analysts had expected. Sales fell as the retailer tries to remake its image. RadioShack dropped 16 cents, or 10 percent, to $1.38.

More evidence of an improving economy came Tuesday when the government reported that wholesalers added to their stockpiles of goods in April, a move that suggests they anticipate stronger growth.

A separate report showed that the number of job openings climbed to 4.5 million in April, the highest figure since September 2007. The increase could be a hint of stronger hiring in the months ahead.