NEW YORK (Reuters) - U.S. stocks rose on Tuesday after company earnings reports were better than expected, with the Dow Jones Industrial Average breaching the 23,000 mark for the first time, while the U.S. Treasury yield curve flattened and the dollar rose to a one-week high on increased inflation expectations.

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

The Dow briefly touched a new high of 23,002.20, powered by earnings from UnitedHealth and Johnson & Johnson. The S&P 500 had been negative as traders were left unimpressed by some bank earnings, but it ticked up before the market closed.

Gains on world stock markets petered out near record-high levels, in part because a rally in commodities helped underpin one of the most durable bull runs in recent history.

Goldman Sachs Group Inc GS.N and rival Morgan Stanley MS.N topped analysts' expectations with their third-quarter earnings, but shares of Goldman fell because the results were fueled by a volatile unit that has sharp revenue swings, analysts said.

The Dow Jones Industrial Average .DJI rose 40.48 points, or 0.18 percent, to 22,997.44, the S&P 500 .SPX gained 1.72 points, or 0.07 percent, to 2,559.36 and the Nasdaq Composite .IXIC dropped 0.35 points, or 0.01 percent, to 6,623.66.

European shares lost ground, with the FTSEurofirst 300 index .FTEU3 dropping 0.17 percent, though they were underpinned by solid earnings from food group Danone DANO.PA and education specialist Pearson PSON.L and talk of a break-up of investment bank Credit Suisse CSGN.S.

MSCI's gauge of stocks across the globe .MIWD00000PUS shed 0.11 percent.

Meanwhile, the yield spread between U.S. 5-year and 30-year Treasuries fell to its lowest since November 2007, and 2-year yields US2YT=RR rose to their highest in nearly nine years.

Spread compression between shorter- and longer-dated maturities was due to increased expectations for interest rate tightening by the Federal Reserve and minimal signs of a pick-up in long-term inflation.

Speculation that U.S. President Donald Trump was leaning toward nominating Stanford University economist John Taylor to head the Federal Reserve helped drive the expectations for rates and inflation rises.

“Taylor is perceived as more hawkish than Ms.(Janet) Yellen so under his potential tutelage, the central bank might lift borrowing rates more aggressively, which would bolster the dollar’s allure,” said Joe Manimbo, senior marker analyst at Western Union Business Solutions in Washington.

The increased expectations, also pushed by the strongest reading on U.S. import prices in more than a year, helped lift the dollar.

The Labor Department said import prices jumped 0.7 percent last month, the biggest gain since June 2016, after an unrevised 0.6 percent rise in August.

A fourth day of gains for the dollar index .DXY, which hit a one-week high, was also supported by broad-based weakness for the euro and the pound.

Knocked by the stronger dollar, the euro slipped to a one-week low of $1.1734 EUR=, having fallen almost 3 percent since hitting a 2-1/2-year high last month.

The euro was last down 0.24 percent to $1.1767, and Sterling GBP= last traded at $1.3188, down 0.45 percent on the day, after comments from Bank of England policymakers that were interpreted as dovish.

“Comments coming out (from BoE policymakers) uniformly signaled a dovish and cautious stance among policymakers and indicated a growing debate internally on the path for interest rates forward,” said Neil Jones, Mizuho’s head of currency sales for hedge funds in London.

The Mexican peso MXN= gained 1.49 percent versus the U.S. dollar at 18.75 after NAFTA trade ministers spoke of some progress in talks about the trade deal.

Oil prices steadied after losing ground, as expectations of high U.S. production and exports offset concerns that fighting between Iraqi and Kurdish forces could threaten the country’s crude output.

U.S. crude CLcv1 rose 0.4 percent to $52.08 per barrel and Brent LCOcv1 was last at $58.24, up 0.73 percent on the day.