NEW YORK (Reuters) - The S&P 500 ended a five-day winning streak on Wednesday as investors' optimism about global economic growth was countered by a steep drop in FedEx Corp FDX.N shares, but the benchmark index managed to hover near all-time highs.

FedEx shares tumbled 10.0% after the U.S. parcel delivery company cut its fiscal 2020 profit forecast on heavy expenses, slowing global trade and fallout from its breakup with Amazon.com Inc AMZN.O.

The decline in FedEx shares weighed on the blue-chip Dow industrials. Shares of rival package delivery company United Parcel Service Inc UPS.N fell 1.9%. The FedEx and UPS losses sent the Dow Jones Transport Average .DJT down 0.9%.

But the Nasdaq notched a record closing high for a fifth straight session.

Even with Wednesday’s nominal losses on the S&P 500, analysts said market sentiment remained largely upbeat following last week’s announcement of an initial U.S.-China trade agreement. Earlier in the session, the S&P 500 hit its fifth consecutive record high.

“Investors have gotten much more comfortable with the path of things that have been dark clouds over the market,” said Wayne Wicker, chief investment officer at Vantagepoint Investment Advisers in Washington. “This is just somewhat of a pause after having such a strong run.”

The market largely shrugged off the likely impeachment of U.S. President Donald Trump as the House of Representatives geared up for a historic vote later in the day on two charges accusing Trump of abusing his power and obstructing Congress.

Impeachment would have little effect on the factors most influential on U.S. markets, said Shannon Saccocia, chief investment officer at Boston Private. “It doesn’t change what the Fed does,” she said. “It doesn’t change what happens from a China perspective.”

The Dow Jones Industrial Average .DJI fell 27.88 points, or 0.1%, to 28,239.28, the S&P 500 .SPX lost 1.38 points, or 0.04%, to 3,191.14, and the Nasdaq Composite .IXIC added 4.38 points, or 0.05%, to 8,827.74.

The small-cap Russell 2000 .RUT hit its highest level in 14 months and ended 0.25% higher.

Facebook Inc FB.O shares rose 2.1%, providing the biggest boost to the S&P 500, as Deutsche Bank raised its price target on the stock.

Advancing issues outnumbered declining ones on the NYSE by a 1.55-to-1 ratio; on Nasdaq, a 1.03-to-1 ratio favored advancers.

The S&P 500 posted 40 new 52-week highs and no new lows; the Nasdaq Composite recorded 166 new highs and 59 new lows.

Volume on U.S. exchanges was 7.72 billion shares, compared to the 6.95 billion average for the full session over the last 20 trading days.