NEW YORK (Reuters) - Oil prices fell sharply on Wednesday after their longest rally in more than five years while stocks ended higher after minutes from the U.S. Federal Reserve’s last meeting showed contrasting opinions.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., July 5, 2017. REUTERS/Brendan McDermid

Tumbling oil prices put pressure on the energy sector, which limited gains for Wall Street’s S&P 500 benchmark.

Federal Reserve policymakers were split on the outlook for inflation and how it might affect the future pace of interest rate rises, according to the minutes of the Fed’s June policy meeting released on Wednesday.

Investors had hoped for insight on the central bank’s plans for interest rate hikes or possible balance sheet reduction.

“We’ve gotten a little bit of weaker economic data of late and we seem to have deflation starting to set in. That does call into question whether or not we are going to see as aggressive a Fed as they are telling us to expect,” said Robert Phipps, director at Per Stirling Capital Management in Austin, Texas.

Trading was also affected on Wednesday by lighter participation the day after the U.S. July 4 Independence Day holiday and ahead of the U.S. jobs report due on Friday.

The Dow Jones Industrial Average fell 1.1 points, or 0.01 percent, to 21,478.17, the S&P 500 gained 3.53 points, or 0.15 percent, to 2,432.54 and the Nasdaq Composite added 40.80 points, or 0.67 percent, to 6,150.86.

U.S. Treasury yields edged lower but were near multi-week or multi-month peaks after the minutes.

Benchmark 10-year Treasury notes last rose 5/32 in price to yield 2.3285 percent, from 2.346 percent.

“Factory orders did send yields lower, and then obviously we sold off initially on the minutes, and then we came back,” said Stanley Sun, interest rate strategist at Nomura Securities International in New York. “By and large these minutes were still relatively neutral.”

The dollar was barely up against a basket of currencies but pared gains after the Fed minutes as traders focused on the rift among U.S. policymakers over the pace of future rate increases with signs of inflation softening. It was last up 0.06 percent.

The yen rose briefly on safe-haven demand after North Korea said it conducted a test of a newly developed intercontinental ballistic missile (ICBM) that can carry a large nuclear warhead. It strengthened 0.05 percent versus the greenback at 113.21 per dollar.

MSCI’s broadest index of Asia-Pacific shares outside Japan closed 0.37 percent higher.

Oil prices fell after eight sessions of gains as climbing OPEC exports and a stronger dollar turned sentiment more bearish. U.S. crude fell 4.25 percent to $45.07 per barrel in its sharpest fall in almost a month and Brent was last at $47.75, down 3.75 percent on the day.

“It’s right on the threshold where if it goes lower, it’ll hurt the market.” said Randy Frederick, vice president of trading and derivatives for Charles Schwab in Austin, Texas. Frederick.

MSCI’s gauge of stocks across the globe gained 0.15 percent.

Spot gold added 0.2 percent to $1,226.18 an ounce. after hitting an eight-week low reached earlier in the session.