NEW YORK (Reuters) - The Dow and S&P 500 eked out record closing highs on Thursday, turning higher at the last minute after a Politico report that Federal Reserve Governor Jerome Powell is the leading candidate for the nominee for Fed chair.

Investors have been anxious to hear who President Donald Trump will pick as the nominee. A decision like Powell would likely be a continuation of the current stock market-friendly monetary policy that has helped fuel the market’s more than eight-year bull run.

Stocks had been recovering from early losses for much of the afternoon but the S&P 500 and Dow were still a tad lower just before the Powell report.

“Clearly at the end it had everything to do with the speculation about Jerome Powell,” said Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia. “I can’t observe any other reason for why we ended up.”

“He’s viewed to be sort of an extension of (current Fed Chair) Janet Yellen by way of being a policy dove ... and, with the market loving more of the same with regard to uber-accommodative monetary policy, as more welcome than the alternative,” he said.

Powell was among several names circulating as possible picks, including Yellen. Others include Trump’s chief economic adviser, Gary Cohn, former Fed Governor Kevin Warsh and Stanford University economist John Taylor.

The White House on Wednesday said Trump will announce his decision on the matter in the “coming days.”

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

Tech shares were among the day's biggest drags, led by Apple AAPL.O, which fell 2.4 percent in its biggest daily percentage decline since Aug. 10 as doubts about its double 2017 iPhone release strategy weighed on investors.

The Dow Jones Industrial Average .DJI rose 5.44 points, or 0.02 percent, to end at 23,163.04, the S&P 500 .SPX gained 0.84 point, or 0.03 percent, to 2,562.1 and the Nasdaq Composite .IXIC dropped 19.15 points, or 0.29 percent, to 6,605.07.

Stocks have posted a string of record highs in recent weeks, and the Dow closed above 23,000 for the first time on Wednesday.

The day also marked the 30th anniversary of the 1987 Black Monday stock market crash. Most traders see a repeat of the crash as unlikely because of modern trading technology and other changes.

Investors also took profits in the broader tech sector, which has had a strong run so far this year, gaining about 30 percent and helping drive the market's recent record run. The tech index .SPLRCT was down 0.4 percent on the day.

Weighing on the market early as well was some disappointing news on the earnings front.

United Airlines UAL.N tumbled 12.1 percent, weighing on other airlines stocks after the third-largest U.S. carrier's profit fell due to flight cancellations during the hurricane season. American Airlines AAL.O fell 1 percent.

Shares of eBay EBAY.O were down 1.8 percent a day after it reported results.

Advancing issues outnumbered declining ones on the NYSE by a 1.04-to-1 ratio; on Nasdaq, a 1.33-to-1 ratio favored decliners.

About 5.8 billion shares changed hands on U.S. exchanges. That compares with the 5.9 billion daily average for the past 20 trading days, according to Thomson Reuters data.