Stocks closed near unchanged on Wednesday, a day after Wall Street's best rally since March, as the oncoming debt ceiling deadline overshadowed strong earnings from Apple Inc.

Apple hit another all-time high one day after the maker of the iPhone and iPad reported quarterly revenues that far exceeded expectations.

The stock jumped 2.7 percent to $386.90 but, overall, investors sat on their hands amid the unresolved debt ceiling crisis in Washington. The White House and Congress were negotiating a deal to raise the U.S. debt ceiling before a looming default on August 2.

The big elephant in the room is the debate about the debt ceiling, and as the clock ticks we all know that we are going to have a deal. It's just how soon, said Mohannad Aama, managing director at Beam Capital Management LLC in New York.

Until then, the market is going to be affected by the daily news that is coming out of earnings season.

The Dow Jones industrial average <.DJI> lost 15.51 points, or 0.12 percent, at 12,571.91. The Standard & Poor's 500 Index <.SPX> shed 0.89 points, or 0.07 percent, at 1,325.84. The Nasdaq Composite Index <.IXIC> fell 12.29 points, or 0.43 percent, at 2,814.23.

Technology shares were lower, with Yahoo Inc tumbling 7.6 percent to $13.48 after reporting lackluster results, and Microsoft Corp dropping 1.7 percent to $27.06 ahead of its quarterly report on Thursday.

Financials were the best performing sector, boosted by a 4.4 percent rise in US Bancorp to $26.14. The Midwestern regional bank said second-quarter net income rose by 57 percent. The KBW Bank index <.BKX> climbed 1.5 percent.

In extended trade, chipmaker Intel Corp shed 0.7 percent to $22.84, while American Express Co added 0.3 percent to $52.26. Intel issued a current-quarter revenue forecast that trumped estimates, while American Express' profits topped expectations.

Sovereign debt problems in Europe and the protracted political battle over increasing the U.S. debt ceiling have weighed on stocks. On Tuesday, there was progress toward a $3.75 billion U.S. budget deal, prompting a late rally, but a resolution remained elusive.

European Union leaders must find a convincing solution to Greece's debt crisis at a Thursday summit or the global economy will pay the price, the head of the European Commission said in an unusually somber warning.

On the U.S. economic front, existing home sales fell unexpectedly to a seven-month low in June as cancellations of pending contracts surged, according to the National Association of Realtors.

Volume was light with about 6.38 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, below the daily average of 7.48 billion.

Advancing stocks outnumbered decliners on the NYSE by 1,658 to 1,314, while losers beat winners 1,532 to 1,023 on the Nasdaq.

(Reporting by Chuck Mikolajczak; editing by Jeffrey Benkoe)