Jan Kozak's team entered the match bottom of the section after losing their opening match of the competition to Wales, but an impressive win over Russia has seen them move onto three points after two matches.
It was Russia that made the brighter start to proceedings and Artem Dzyuba's physical presence caused Slovakia some problems in the opening 10 minutes, with the striker having two powerful strikes blocked inside the box.
The first serious attempt of the match came in the 10th minute when Hamsik found space down the Russian right, but the Napoli midfielder cleared the crossbar with a powerful shot.
Clear opportunities were few and far between as both teams cancelled each other out in Lille and a long-range strike from Fedor Smolov, which missed the target, was about as close as Russia came to making the breakthrough in the opening 20 minutes.
Dzyuba directed a header towards the bottom corner in the 23rd minute as Russia continued to dominate the match aerially, but Slovakia goalkeeper Matus Kozacik was on hand to make the save.
Russia again came close in the 28th minute when Dzyuba fed Smolov in an advanced position, but the number 10's effort just shaved the outside of the Slovakia post.
It was Slovakia that made the breakthrough just past the 30-minute mark, however, when Weiss collected a sweeping pass from Hamsik before moving inside two Russian defenders and curling past Igor Akinfeev.
Hamsik continued to influence the match as the first period approached its latter stages, and the 28-year-old sent a powerful effort just wide of the post after skipping past the challenges of two Russians.
Hamsik made no mistake in the 45th minute, however, as the Napoli midfielder collected a short corner from the left before absolutely hammering one into the top corner to send Slovakia into a two-goal lead.
Robert Mak came close to scoring a third for Slovakia 10 minutes into the second period when he advanced unchallenged inside the Russian box, but the striker's effort brought a smart save from Akinfeev.
Russia were more offensive as the match approached the hour and Shatov had an opportunity to halve the deficit when he found all sorts of space outside the Slovakia box, but the number 17 fired his effort into the stands.
Aleksandr Kokorin was the next player in a red shirt to come close after smart build-up outside the Slovakia box, but the attacker's effort was blocked into the arms of Kozacik, before Smolov was denied by a smart challenge from Jan Durica.
Russia continued to dominate the possession as they passed and probed in the final third, but aside from a couple of half-chances, Slovakia were comfortable as the match entered its final 10 minutes of action.
Substitute Pavel Mamaev tried his luck from distance as Russia looked for another late rally, and they were back in the match in the 80th minute when Glushakov headed a Shatov cross into the back of the net.
Slovakia just could not keep the ball in the minutes that followed as Russia launched a late onslaught, but Leonid Slutsky's side could not find an equaliser as they remained on one point in the section.
Russia will complete their Group B campaign against Wales on Monday night, while Slovakia will take on England. Tomorrow afternoon, group leaders Wales will take on third-placed England in Lyon.