Melbourne & Olympic Parks, Olympic Blvd, Melbourne VIC • 3001, Australia, 1 April 2017 | AAP

Nick Kyrgios has come up just short of reaching his first ATP Masters 1000 final, after Roger Federer’s season of resurgence took another thrilling turn in an enthralling Miami Open semi-final.

Kyrgios survived two match points in the second-set but could not save a third as fourth-seed Federer prevailed 7-6(9) 6-7(9) 7-6(5) in a contest that lasted three hours and nine minutes.

“I showed a lot of fight,” Kyrgios said. “Obviously I’m an emotional guy. I had some ups and downs, a bit of a roller coaster.

“Ultimately I thought I put in a good performance. I thought the crowd would have enjoyed it.”

Federer had won eight straight tie-breaks before dropping the second set to No.10 seed Kyrgios.

“It’s great winning this way,” Federer said. “It could have gone either way. It was a nail biter.”

Federer’s semifinal win was a match that had everything, and is arguably the best match of the year to date.

The 35-year-old was his usual clinical, unflappable self, but Kyrgios played entertaining, engaging tennis and will have picked up a host of new fans.

The 21-year-old exhibited acts of sportsmanship, conceding a point after advising Federer to challenge, and showcased the undoubted talent – including his trademark ‘tweeners’ .

“I think he’s good for the game,” Federer said of Kyrgios after the match.