NEW YORK (AP) — Rafael Nadal's summer keeps getting better.

A day after winning an Olympic gold medal in Beijing, Nadal officially unseated Roger Federer to become the world's No. 1 tennis player when the ATP rankings came out Monday.

Federer had been atop the rankings for 235 weeks, but Nadal has won six tournaments this year and heads into next week's U.S. Open as the favorite to win his third straight Grand Slam.

He has won 38 of 39 matches on tour and beat Federer in the finals of the French Open and Wimbledon this summer.

Nadal beat Fernando Gonzalez of Chile in straight sets Sunday to win a gold medal for Spain in men's singles.

Federer continued his yearlong slump when he lost in the quarterfinals to James Blake, though he did take a gold medal for Switzerland in doubles with partner Stanislas Wawrinka.

Ana Ivanovic is back on top in the women's rankings. The 20-year old Serb, who held the No. 1 WTA ranking for nine weeks from June 9-Aug. 11, moved past compatriot Jelena Jankovic.