In a front of a packed Rod Laver Arena, the Russian dominated the first-set tiebreaker and dug out a late break to take a two-set lead.
Kyrgios rallied and captured the third set, but Medvedev dominated the fourth, winning the final four games to seal his first career victory against the talented Aussie.
US Open champion outwits hometown favorite to reach last 32
Medvedev struck first, breaking on his third chance in the opening set to take a 2-1 lead. Kyrgios was able to retrieve the break to get back on serve at 4-4.
Both men held and the set would be settled in a tiebreaker where the Russian won six points on the spin to close out the first set. Kyrgios gutted out a hold late in the second set to make the score 4-4.
Unlike the first set, he couldn't hold out as a missed volley gave Medvedev triple break point and a duffed backhand gift-wrapped the break and with it, the set to put the reigning US Open champion in commanding position.
Both men continued to hold strong in the third set, Kyrgios firing down three aces in the sixth game and after coming to net, a hip-high volley gave him a break and a 4-3 advantage.
Serving for the set, the Aussie further entertained the crowd, winning the final three points of the tenth game, the last with a big serve and drop shot to seal the set and extend the match.
Medvedev saved a pair of break points in the opening game of the fourth set and midway through, he broke it open with a backhand to go in front 4-2.
A solid hold, capped off with an ace, put the Russian within a game of victory and he held two match points after Kyrgios missed a forehand. A point later, he was the victor in a match to be remembered.