Lawrence Shankland's first-half penalty put them ahead before the break, and Alan Forrest's strike in stoppage time sealed victory.

Hearts had goalkeeper Craig Gordon to thank at points, especially for tipping one effort on to the woodwork.

They also passed up good chances to add to their tally - including Shankland missing an empty net.

In the end it did not matter as Hearts move second in Group A behind Istanbul Basaksehir - who defeated Fiorentina 3-0 - as Robbie Neilson's side prepare to face the Serie A club home and away next.

The win in Riga keeps some hope of progression alive for injury-hit Hearts, who were handed a sixth defeat in seven games by Basaksehir last week when the Turkish side left Edinburgh with a 4-0 win.

Hearts go from sticky patch to sizing up Fiorentina
Reaction & as it happened
Given that display, this was a must-win game for Neilson and his squad and at various stages of the first half they looked rattled, especially when centre-back Craig Halkett limped off 20 minutes into his return from injury.

RFS - last season's champions of Latvia who earned a shock draw in Florence in their opening match - hit the woodwork after two minutes when Gordon was at his acrobatic best to tip Emerson's shot onto the woodwork.

And the Hearts keeper pulled off another two stops in quick succession to keep his side in front just before half-time.

But Hearts were equally as dangerous in spells before the break, and had the better of the second-half without exerting total control throughout.

By that point Shankland had emphatically stroked his penalty into the top corner after Elvis Stuglis blocked Andy Halliday's cross with his arm, and missed an open goal on the stretch when Josh Ginnelly slightly overhit his pass across the six-yard box.

Nevertheless, Hearts did more than enough to earn a difficult victory, their first in European group stage football for 18 years, and made sure of it when Cammy Devlin broke free at the end before teeing up Forrest to slot home.