This puts her within reach of her best-ever achievement in a Grand Slam tournament.
Sevastova beat Andreescu with superior serve work and receiving balls, however, Andreescu managed to secure a single set, putting Sevastova on the edge in the third.
Sevastova will face Qiang Wang (WTA 21) in the third round. The Latvian's best result so far at an Australian Open is reaching the round of eight in 2011.
Latvia's No. 2 Jeļena Ostapenko (WTA 22) is out of the tournament, and both Ostapenko and Sevastova are out of the doubles tournament.