NEW YORK (Reuters) - The S&P 500 eked out another record high close on Tuesday and capped its best four-month stretch in nearly nine years after a recent rally that helped to restore investors’ belief in the decade-long bull run.

Apple shares jumped about 5 percent following its quarterly results after the bell, which will help to ease worries about the earnings outlook for the S&P 500, even as Google-parent Alphabet tumbled during the session in the wake of a revenue miss.

S&P 500 e-mini futures were last up 0.2% and jumped following the report from Apple, which forecast stronger-than-expected third-quarter revenue. Apple Chief Executive Tim Cook also said iPhone sales had begun to stabilize in China.

Besides a mostly better-than-expected earnings season, analysts said market-positive economic data, a dovish Federal Reserve and hints of progress in U.S.-China trade talks have all helped drive recent gains.

“All in all, things for the market are looking pretty decent: a friendly Fed, low rates, growing earnings. It doesn’t get much better than that,” said Bucky Hellwig, senior vice president at BB&T Wealth Management in Birmingham, Alabama.

With more than half of the S&P 500 companies reporting, analysts now expect first-quarter earnings to have risen slightly from a year ago, a stark reversal from the 2% fall estimated at the beginning of the month, according to Refinitiv data.

But not all results have been upbeat. During the regular session, Alphabet shares fell 7.5% in their worst decline since October 2012 after the company reported its slowest revenue growth in three years.

Slideshow ( 3 images )

Apple shares were down 1.9% during the day.

The S&P communication services sector slid 2.5%, dragged down by Alphabet, and registered its biggest percentage drop in about four months.

The Dow Jones Industrial Average rose 38.52 points, or 0.15%, to 26,592.91. The S&P 500 gained 2.8 points, or 0.10%, to 2,945.83, and the Nasdaq Composite dropped 54.01 points, or 0.66%, to 8,095.39.

For the month, the Dow rose 2.6%, the S&P 500 gained 3.9% and the Nasdaq added 4.9%. All three indexes posted their best monthly percentage gains since January.

The S&P 500 now up 17.5% since the end of December.

The Dow was boosted by gains in Chevron Corp. The company’s shares rose 2% after Warren Buffett’s Berkshire Hathaway Inc committed $10 billion to Occidental Petroleum Corp’s bid for Anadarko Petroleum Corp, boosting its chances of snatching a deal from Chevron.

Slideshow ( 3 images )

Pfizer Inc and Merck & Co Inc rose more than 2% each after the drugmakers beat quarterly earnings estimates.

General Electric Co jumped 4.5% after the industrial conglomerate’s first-quarter profit rose and its negative cash flow was smaller than expected.

Mastercard Inc rose after the card company beat estimates for quarterly profit.

The Fed’s two-day meeting that ends Wednesday will be in focus for hints on the direction of U.S. interest rates.

Investors will also pay close attention to the next two rounds of U.S.-China trade negotiations after Treasury Secretary Steven Mnuchin said he hopes to make “substantial progress” with Chinese negotiators.

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

The S&P 500 posted 49 new 52-week highs and no new lows; the Nasdaq Composite recorded 78 new highs and 45 new lows.

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