Federer and Nadal were both close to the top of their games during the opening set as they held their serves to keep things tight.
The first set was remarkable in how many break points both players saved. Just as it seemed that one player had stolen the advantage the other produced a heroic effort in order to keep themselves in the game.
However in the eighth game Federer finally found a chink in Nadal's armour with a fine return and he got the break he needed having let a couple of break points slip in that game.
In the second Nadal massively stepped up his service game and this time he took the set longer as Federer struggled to cope with the power in his opponent's serve.
In the seventh game it seemed as if Federer had broken but Nadal saved by playing a drop shot and then volleying away from Federer superbly as he went on to hold again.
However once again Federer found a break, this time thanks to an incredible swivel return that Nadal had no answer to.
He produced an outrageous backhand down the line, one of many, in the final game and he served out to win the match.
It means that he has now won 19 matches this season, being defeated just once so far, his only loss having come against Russian Evgeny Donskoy in the second round in Dubai.
It also is the third time that Federer has beaten Nadal this season, having defeated him in the Australian Open final as well as at Indian Wells. This is the first time that he has won four matches in a row against the Spaniard.
It is a stark contrast to the pair's previous head-to-head record and goes to highlight how well Federer is playing at the moment.
The last time he started the year winning these three tournaments was 2006.
Federer moves up to fourth in the world, as he continues on his dream of returning to the very top in the world.
Read the original article on Eurosport: Federer beats Nadal again to win Miami Open