The 20-year-old Aussie Kyrgios saved two match points in the third-set tiebreak in order to oust the former world No. 1 great Federer 6-7 (2-7), 7-6 (7-5), 7-6 (14-12) in 2 hours, 37 minutes. Federer saved five match points to make Kyrgios sweat out the victory.

Kyrgios swatted 22 aces in a 38-ace affair that featured only four service breaks in 39 games at the Magic Box. This marked the second Top-10 victory for the young gun Kyrgios, the youngest player in the men's Top 50.

The 33-year-old Federer headed to Madrid fresh off his title in Istanbul. The 17-time Grand Slam champion won the Madrid title in 2009 and 2012. He also prevailed in 2006 when the tournament was played in the fall on hardcourts, and last played at the Magic Box in 2013, falling to Kei Nishikori in the round of 16.

Meanwhile, after enjoying an opening-round bye, the second-seeded Murray outlatsed German Philipp Kohlschreiber in a late-night battle, which ended at 3 a.m. local time, winning 6-4, 3-6, 6-0.

Murray, who won the title here in 2008, also beat Kohlschreiber in Monday's final at the BMW Open in Munich. It was Murray's first-ever clay-court final and title.

"I went out there to do a simple game with no complications," said Nadal. "I tried to play easily. I know how things work out when you come from losing a couple of matches. I know that you're a little bit nervous whenever you finish a game, as I finished the other day with [Fabio] Fognini in Barcelona.

"I tried to start from the bottom and just go up. I think, especially the last three games, I finished pretty well. I managed to do a couple more things with my backhand."

Nadal captured a second straight Madrid title last year by beating Nishikori in the final.

Up next for the nine-time French Open king will be Simone Bolelli, who overcame qualifier fellow Italian Luca Vanni 4-6, 6-3, 6-2 on Day 4.