By Joe Wallace and Paul Vigna

U.S. stocks were mostly lower Wednesday, taking a pause after months of steady gains, even after the Federal Reserve pledged to continue its plan of aggressive monetary policy to stimulate the economy for the next few years.

The Dow Jones Industrial Average fell 282.31 points, or 1%, to 26989.99. It briefly traded higher after the Fed statement, after falling as many as 334 points in the morning. The S&P 500 fell 17.04 points, or 0.5%, to 3190.14.

The tech-heavy Nasdaq Composite bucked the declines of the other two major indexes, rising 66.59 points, to 0.7%, to 10020.35, a fresh record high.

It was the index's first close above the 10000 mark, and it came just 114 trading days after first crossing the 9000 mark. That was the fewest number of days between 1,000-point levels since the index went from 4000 to 5000 in just 49 days in the year 2000.

The Federal Reserve on Wednesday said it was committed to providing more support to the economy in the wake of the coronavirus pandemic. To that end, it projected it wouldn't raise interest rates through 2022, and that it would maintain its recent pace of purchases of Treasury and mortgage securities.

The Fed's support has been a key driver of an equities rally that has taken over markets since lows in March. The gains have also been fueled by hopes for an economic recovery as most U.S. states loosen stay-at-home and lockdown restrictions, which have bolstered recovery predictions and in turn equities.

The reopenings, however, won't automatically lead to a recovery, said Joseph Amato, the president of Neuberger Berman Group.

"We would be careful not to misinterpret the speed of the reopenings," he said. What will support the market is the strength of the recovery. If it turns into a long, drawn-out recovery, "then the markets may have gotten ahead of themselves," he said.

In bond markets, the yield on the 10-year U.S. Treasury note fell to 0.744% from 0.829% on Tuesday. Yields fall as bond prices rise.

One concern for investors on Wednesday, the Organization for Economic Cooperation and Development said a second wave of lockdowns to counter a resurgent novel coronavirus would deal a terrible blow to a global economy already facing a severe contraction. The OECD said it expected the global economy to contract by 6% this year if a second wave of infections and containment measures can be avoided.

For now, investors are seemingly more focused on riding the rising tide of equities than they are about the economic picture, said Rupert Thompson, chief investment officer at Kingswood Holdings.

"To the extent this rally continues, it's going to be people jumping in late in the game because they've missed it so far," he said.

The market can ride this wave for another couple of months, he said. At that point, government aid programs may lapse, and there could be another wave of bankruptcies and a second wave of layoffs, to say nothing of a possible second wave of infections, he said. "Only then will the v-shaped recovery story get put under pressure."

Among equities, shares in United Airlines Holdings fell 11% to $39.72, after analysts at JPMorgan Chase cut the stock to neutral. Delta Air Lines fell 7.4% to $31.64 and Southwest Airlines dropped 2.3% to $37.14. Cruise operators Carnival lost 11% to $20.59 and Royal Caribbean Cruises was down 9% to $63.59.

Shares in such transport and leisure companies, which were punished earlier in the year, have surged in recent weeks amid optimism about the reopening of the U.S. economy from lockdown.

Shares of Uber fell 4.8% to $34.83 after the Journal reported Just Eat Takeaway.com is near a deal to acquire Grubhub, which was in acquisition talks with Uber. Grubhub shares rose 2% to $59.05. Just Eat ADRs lost 11% to $10.

Oil prices also rose after the Fed report, despite a weekly report this morning that showed U.S. inventories of crude oil rose to a record-high in data going back to 1982. U.S. crude futures rose 1.7% to $39.60 a barrel.

International stock markets posted tepid gains. The Stoxx Europe 600 fell 0.4%. Japan's Nikkei 225 index closed 0.2% higher, helped by health care and electronics stocks. The equity benchmark in South Korea rose 0.3%, while Hong Kong's Hang Seng Index ended trading almost unchanged.

China's Shanghai Composite fell 0.4% after data showed industrial prices sliding deeper into deflation in May, declining 3.7% from a year earlier. Consumer inflation eased due to softening food prices, slowing to 2.4%. Both figures undershot consensus forecasts from economists polled by The Wall Street Journal.

Write to Joe Wallace at Joe.Wallace@wsj.com and Paul Vigna at paul.vigna@wsj.com