Nadal, on the other hand, beat Italian Fabio Fognini 6-1, 7-5 in the other semi-final.

When Federer won the third tie-break, a furious Kyrgios hammered his racket into the ground three times as the frustration of a remarkable near-miss came flooding out.

Kyrgios broke in the first set to go 4-3 up but Federer, with the loud crowd behind him, broke back to level at 5-5 when the Australian missed with an attempted big return.

The big-hitting Kyrgios was frequently booed by the crowd for racquet throwing and language - and sometimes for very little - but appeared to be enjoying the role of pantomime villain.

The first set tie-break was a gripping affair with the Australian twice having set point before it was decided when his return went wide. The boos rang out again as he hurled his racquet in frustration.

The serve dominated more in the second set and with neither player able to break another tie-break was needed. Federer had match-point at 8-7 but found the net with his return.

Kyrgios finally won the battle with an amazing cross-court return to go 10-9 up, then followed it up with a thundering ace to force a third set.

There was nothing to choose between the pair in a third set that went to yet another tie-break.

Kyrgios was furious when a fan called out during one point, and Federer enjoyed two successful challenges late on his way to a win that sent the crowd wild with delight as Kyrgios went wild with rage.

There was little drama in Nadal's 6-1, 7-5 win over Italian Fabio Fognini.

The unseeded Fognini struggled to get going in the first set which was dominated by fifth-seeded Nadal and over with in 25 minutes.

The Italian, who indicated he had some trouble with his elbow, put up a better response in the second but his work was undone when he double-faulted on break point, leaving the Spaniard to serve out for the win.

Nadal will play in his fifth Miami final but will be looking for his first title in the Masters series event.