The volatile home favorite, who was fined $3,000 for swearing on court on Monday, defeated Uruguay's Pablo Cuevas 6-4 7-5 7-6 (7/2) in just under two hours.
But he had to contend with an unexpected distraction when he appeared to become discomforted by the white shorts he was wearing.
A visibly agitated Kyrgios departed the court for a bathroom break midway through the second set and came back dressed in a fresh pair of black shorts.
The costume change seemed to work, with the Australian bashing down serves upon his return to the Hisense Arena.
"Oh, mate, it was an absolute circus," Kyrgios said on court after the match in comments carried by the Australian Open website.
"I'm not going to talk too much about it, but it was just a massive mix-up, and I guess that's just part of some of the challenges you face. I hope I get the right ones for the next match."
Kyrgios, who was fined by the ATP last year for comments he made to Stan Wawrinka while on court,
will now face sixth seed Tomas Berdych for a place in the last 16 after the Czech defeated Mirza Basic 6-4 6-0 6-3.
"He's going to be wanting to win as much as I'm going to be wanting to win, so it's going to be tough," Kyrgios later told reporters of his next opponent.
"The crowd's going to be crazy. They all love Berdych. He has a massive fan base. He's one of the greatest players right now (so) it's going to be a really good match."
Kvitova eliminated by unseeded Gavrilova
Fashion items aside, the biggest shock Wednesday came when unseeded Daria Gavrilova shocked sixth seed Petra Kvitova 6-4 6-4.
The Russian born Gavrilova, who emigrated to Australia in 2014, had never gone beyond the second round of a grand slam but was cheered on to victory by a vociferous home crowd.
"You guys are crazy," she jokingly told her most enthusiastic fans on court after the match. "Obviously good crazy, you help me a lot.
"(Winning) means lot. I'm just really happy and I just have to prepare for the next one (now)."
Elsewhere in the women's draw, World No.1 Serena Williams defeated Hsieh Su-Wei of Taiwan 6-1 6-2 while Maria Sharapova made short work of Aliaksandra Sasnovich with a comfortable 6-2 6-1 victory.
However, there was to be no happy comeback for Eugenie Bouchard who was crushed by Agnieszka Radwanska 6-4 6-2.
The 21-year-old Canadian was making her first grand slam appearance since being forced to pull out of last year's U.S. Open when she slipped and sustained a head injury in the locker room.
Federer cruises, Djokovic holds off late rally
In the men's draw there was to be no repeat of the drama which saw Rafael Nadal humbled by compatriot Fernando Verdasco on Tuesday.
Big guns Novak Djokovic, Roger Federer, Jo-Wilfried Tsonga, Kei Nishikori and Marin Cilicall made light work of their second round opponents.
Federer put friendship to one side as he comfortably swept aside practice partner Aleksandr Dolgopolov 6-3 7-5 6-1, while Djokovic saw off 19-year-old French qualifier Quentin Halys 6-1 6-2 7-6 (7/3).
"Quentin is new on the tour but definitely today he hasn't been playing like he's been just on the tour for under a year," said Djokovic after his young opponent took the match to a tie break in the third set.
"He played some great tennis and I want to congratulate him for fighting and especially in the third set."
Djokovic will now face Italy's Andreas Seppi in round three while Federer will face former world No. 8 Grigor Dimitrov.