Roger Federer beat Rafael Nadal 6-4, 3-6, 6-1, 3-6, 6-3 to win the men’s singles title at the 2017 Australian Open on Sunday. In a captivating match between the two legends, Federer played remarkable tennis after trailing 1-3 in the last set to win his record 18th Grand Slam, his fifth Australian Open title and his first Grand Slam triumph since Wimbledon in 2012. He had last won the Australian Open in 2010.

It was all even in the first set as both Nadal and Federer held serve and were locked 3-3. The 17-time Grand Slam picked the perfect moment to showcase his flowing array of shots to manage to break his Spanish opponent and get the break. He followed it up by holding serve in the next game and rushing to a a quick 5-3 lead. Nadal held on by winning the next game on serve but the Swiss maestro stayed cool to pick up the first set 6-4.

But Nadal fought back emphatically by breaking the 17-time Grand Slam champion early in the second set and cruising to a 4-0 lead. Federer pulled out his flowing backhands to get one break and followed it up by capitalising on unforced errors from Nadal to narrow the lead down to 2-4. But he committed too many unforced errors from there on to give the Spaniard the set 6-3.

Another momentum shift was in the offing as Federer held off an early challenge from Nadal in the first game of the third set to hold serve. He followed it up with some flowing tennis forehands to break his 30-year-old opponent to go to a 3-0 lead. Federer’s crisp movement had returned in right stead as he went on the front foot, cutting down the unforced errors to break Nadal again and win the set 6-1.

Nadal, though, pulled out all the stops, making some delightful returns and forcing Federer into even more unforced errors. He got the break in time and then ensured that the match would go into a decider, clinically winning the set 6-3.

The Spaniard then struck early in the deciding fifth set breaking Federer in the very first match and then held off three break points in the second to go up 2-0. He consolidated the lead further by saving another break point on his way to a 3-1 lead. But just when Nadal seemed to be heading to a 15th title, the old wily master pulled out one last trick breaking the Spaniard in the sixth game and then polishing off a quick service game to take a 4-3 lead. Nadal looked down and out trailing 0-40 then fought back to deuce and finally ended up on the wrong side of an epic 26-shot rally. Federer was just too good as he grimly held on to record history, winning the set 6-3 and with it, the final.