NEW YORK — The stock market broke through two milestones Monday before giving up nearly all its gains late in the day.

Stocks rose from the opening bell, lifting the Dow Jones industrial average above 16,000 for the first time and Standard & Poor’s 500 index past 1,800, two big markers in a historic bull market. But by day-end, both indexes had fallen below those levels.

“The market is always a little hesitant when it gets to round numbers,” says Ed Cowart of Eagle Asset Management. “You don’t want to be the first guy buying at 16,000 on the Dow.”

The Dow eked out a gain over Friday’s close, ending 24 points shy of 16,000. Both the Dow and the S&P 500 are on track for their best years in a decade, soaring more than 140 percent since bottoming out in the Great Recession more than four years ago.

Investors have pushed stocks up sharply this year as the U.S. economy improves, companies report record profits, and the Fed keeps up its easy-money policies.

“The Fed is still pumping money into the system, which is helping fuel the market,” says Frank Fantozzi of Planned Financial Services, a wealth manager. “There’s much more confidence in the market.”

The Dow has risen six weeks straight and is up 22 percent this year. The market hasn’t risen that much in a year since 2003.

The Dow has pushed through round-number milestones twice this year: 14,000 in February and 15,000 in May. The quick climb has led some experts to wonder if stocks are too high and set to tumble.

Brad McMillan of Commonwealth Financial said he’s not worried yet, but notes three ingredients are present: Investors borrowing record amounts to buy stock, more companies going public for the first time, and Main Street investors putting money in the market after years of pulling out.

It’s not clear if stocks have become expensive yet or are just fairly priced. One measure of value, the ratio of stock prices to forecast earnings, is at 15 for S&P 500 companies. That is slightly below the 15-year average of 16.2, according to FactSet, a data provider.