Dainis Kazakevics's side went into their final match of the campaign with a two-point lead over Moldova at the top of Group D1 and knowing that their fate was firmly in their own hands.
Simply avoiding defeat against an Andorra side they beat 3-0 in June would secure top spot, but they made their supporters sweat courtesy of late goals in both of the group's games today.
Vladislavs Gutkovskis opened the scoring for Latvia five minutes into the second half of their match, and it looked as though they would make it five wins from six until Andorra's late equaliser.
Albert Rosas netted for the hosts to earn them a point, and two quickfire goals late on for Moldova in the group's other game meant that they could not afford another slip-up.
Latvia held on to top the group by virtue of their superior head-to-head record over Moldova, whose late show in Chisnau was ultimately only enough to finish second, level on points with Latvia.
A stoppage-time brace from Victor Stina at least ensured a winning end to the campaign for Moldova, seeing Liechtenstein fall agonisingly short of their first point of the group in the process.