Tommy Paul took down Rublev, beating the fourth seed for the first time in four meetings, while the ninth-seeded Shapovalov fell to Aslan Karatsev.
Playing in the main draw at Indian Wells for the first time, the 24-year-old American Paul outlasted Rublev 6-4 3-6 7-5 for his second win in eight career matches against top-10 players.
Paul was on the offensive throughout the match, firing 41 winners while making 37 unforced errors, while Rublev had 23 of each.
The Russian will lament missed opportunities, as he converted just four of 14 break point chances before watching Paul break him twice in the final set to prevail.
Paul moves on to face 21st seed Cameron Norrie, who beat Roberto Bautista Agut 6-4 5-7 6-3.
The news was not all bad for the higher seeds, though, as US Open champion Medvedev picked up his 50th win of the year.
Medvedev had to work a bit to get past 27th seed Filip Krajinovic 6-2 7-6 (7-1), improving to 38-5 on hard courts in 2021. Only Stefanos Tsitsipas (52) has more victories overall this year.
The Russian had 25 winners and 18 unforced errors while winning 70 per cent of points on his first serve.
He next faces 23rd seed Grigor Dimitrov, who downed 16th seed Reilly Opelka 6-3 6-4.
Playing at Indian Wells for the first time, 19th seed Karatsev upset Shapovalov 7-5 6-2, saving the only break point he faced in the match.
Casper Ruud, seeded sixth, rallied past Lloyd Harris 6-7 (4-7) 6-4 6-4 as he seeks his sixth tournament title this year.
He will face 11th seed Diego Schwartzmann, who beat 18th seed Daniel Evans 5-7 6-4 6-0 to reach the fourth round at Indian Wells for the first time.
Eighth seed Hubert Hurkacz had little trouble with Frances Tiafoe, rolling past the American in straight sets.
Jannik Sinner, the 10th seed, advanced via walkover when John Isner withdrew from the tournament to fly home and be with his wife Madison with their third child expected to arrive ahead of schedule on Tuesday.