The Australian fell to the floor in celebration after clinching the victory, before sticking a finger behind his ear and asking the raucous crowd to cheer louder.
Spaniard Nadal, who has won the tournament twice, took only one of his 10 break point chances and failed to put the match away despite leading 6-3 in the final set tiebreak before Kyrgios reeled off five straight points.
World number 72 Kyrgios improved his career record against Nadal to 3-3.
After dropping the first set, Kyrgios called for the trainer and said that he felt sick but would play on as he feared the media would “blow it up”.
He returned to the court for the second set and immediately looked a different player.
At one stage a frustrated Nadal called for the crowd to quieten down, a request that received backing from Kyrgios, who screamed “shut up” together with an expletive, an outburst that brought him a warning from the umpire.
After calling for the trainer again between the second and third sets due to a sore back, Kyrgios then saved five break points in the sixth game of the final set.
He got out of jail again in the deciding tiebreak, particularly on the second match point when his volley caught the tape but toppled over and landed on the line.
The match did not end there. After a less than enthusiastic handshake, both players headed to the interview room for a verbal rally with Nadal acknowledging Kyrgios's prodigious talent while admonishing the Australian's alleged lack of "respect".
"He's a player who has enormous talent, could be winning Grand Slams or fighting for the number one ranking," Nadal said. He (Kyrgios) lacks respect for the crowd, the rival and towards himself."
When it was his turn in the hot seat, Kyrgios shot back, telling Nadal to mind his own business.
"I’m different, Rafa is different. He can focus on what he needs to do.” Kyrgios said. “He doesn’t know the journey I’ve been through, he doesn’t know me. So I’m not going to listen at all.
“That’s the way I play. That’s the way he plays, he’s very slow between points and the rule of the book says you have to play at the speed of the server. But Rafa has the speed every time.
"I’m not going to comment on him and his game. I’ve got my game.“I’m not going to take that (Nadal’s comment) into consideration at all."
Next up for Kyrgios is Swiss Stan Wawrinka, who defeated American Steve Johnson 7-6(5) 6-4.