The world number two - the third seed at the All England Club - prevailed 6-3 3-6 7-6 (7-5) 7-6 (7-3) but will hope to avoid too many more days like this one.
Kyrgios, who was pictured in a local pub late the night before, initially enjoyed playing the clown as the pair shared the first two sets, before he piled the pressure on Nadal in the next two.
Nadal was good enough to come out on top yet needed a pair of tie-breaks in front of an engrossed crowd on Centre Court.
The charismatic Kyrgios had outlined his aim to "have some fun" against Nadal and, despite trailing early, he certainly did that.
Nadal's breakthrough arrived when an under-hit 'tweener' set him up to smash into the lead, but Kyrgios had the crowd on their feet when an underarm serve kept him in the set.
The Spaniard passionately celebrated when he wrapped up an opener in which Kyrgios had repeatedly complained to the umpire of his opponent's failure to be ready to receive serve.
The highly-motivated Kyrgios sensationally broke Nadal at the start of the second and then brilliantly battled to a subsequent hold.
Another underarm serve this time angered the fans, bringing loud jeers that prompted a Kyrgios shrug, and Nadal was level with a break to love.
Kyrgios was given a warning as he again implored the umpire to punish Nadal's poor timekeeping, yet he broke back as he levelled the match at a set apiece.
A tense third set stayed on serve all the way through to a tie-break, where Nadal wrong-footed Kyrgios for the crucial first mini-break as he edged back in front.
The fourth went the same way and, unfortunately for Kyrgios, had the same result, the Australian failing to recover after horribly miscuing a simple volley on the first point of the tie-break.