Marek Hamsik opened the scoring with a sixth-minute penalty before Marek Sapara doubled the lead four minutes later and although Latvia pulled one back with five minutes to go, they could not force an equaliser.
The hosts made an ideal start when they were awarded a penalty in the sixth minute following a foul by Andris Vanins on Vladimir Weiss. Hamsik stepped up and placed the ball into the bottom left-hand corner of the goal.
Just three minutes later, Slovakia doubled their lead when Sapara drilled a free-kick home from 20 yards.
Hamsik was proving to be a constant menace, forcing goalkeeper Vanins into parrying clear and it was half an hour before Latvia had a real threat on goal when Oleg Laizans' shot from the left was blocked by goalkeeper Dusan Kuciak.
However, the Latvians were given a lifeline five minutes from time when they were awarded a penalty after Viktor Pecovsky fouled Maris Verpakovskis.
Verpakovskis stood up to drill the spot-kick home, but they could not force an equaliser.