A youthful Gretna side showed their inexperience as a Hearts side inspired by Lithuanian striker Andrius Velicka brushed the visitors aside.
Hearts striker Andrius Velicka has now scored 14 goals this season
Hearts threatened from the start, and Velicka opened the scoring after a fine pass from Michael Stewart.
Velicka, Hearts' top scorer, doubled his goal tally before the break from the penalty spot.
Gretna were reduced to 10 men when Danny Hall was sent off and Hearts coasted through the rest of the game.
Gretna, in their first SPL match since the end of the transfer window, unveiled a new-look side, with six players aged 21 or under.
Hearts pressed from kick-off, and Velicka was first to go close after springing the offside trap but, after rounding the goalkeeper, he could only hit the side netting.
The Lithuanian was handed a second opportunity a moment later when Stewart threaded the ball through to him and he rifled home a powerful effort to put the home side ahead.
Velicka tried to repay the favour shortly after as he set up Stewart, however, a diversionary run by Ksanavicius put the midfielder off, and the chance was lost.
Gretna threatened through Kenny Deuchar as Gavin Skelton's cross caught the Hearts defence napping, but the striker's headed effort went over the bar.
Christos Karipidis almost scored his debut goal for Hearts with a close range shot from a well-worked corner, but Gretna goalkeeper Greg Fleming was equal to the effort and tipped the ball over.
Andrew Driver's opportunistic drive livened up a first-half which had become somewhat pedestrian, but the rasping shot flew over Fleming's goal.
Just as it seemed the half would fizzle out, Gretna defender Hall felled Velicka in the box and the striker made no mistake from the penalty spot to claim his second of the match.
Driver had the first chance of the second half when he dribbled past his marker before unleashing a powerful shot from the edge of the box, but again his effort was off target.
Velicka went down in the box again under the challenge of Gretna captain Chris Innes, but the referee waved away his penalty claims.
Deividas Cesnauskis was then set up by Ksanavicius as Hearts continued to dominate, but the midfielder's shot flew over.
Just as it seemed that Gretna were working their way back into the match, Hall received a second yellow for a clumsy challenge on Ksanavicius, and the visitors were down to ten men.
Substitute Saulias Mikoliunas came close to adding a third when Hearts counter-attacked from a Gretna corner, but the midfielder shot straight at Fleming, who parried the ball.
Velicka came close to grabbing his hat-trick after running on to Christophe Berra's long pass, but one-on-one with goalkeeper, he blasted his shot wide of the post.
Hearts put the Gretna defence under pressure in the closing stages, but a combination of missed chances and desperate defending prevented any further scoring.
Hearts: Banks, Neilson, Karipidis, Berra, Goncalves, Cesnauskis (Mikoliunas 70), Stewart (McCann 84), Palazuelos, Driver, Velicka, Ksanavicius (Elliot 77). Subs Not Used: Basso, Wallace, Zaliukas, Beniusis.
Goals: Velicka 3, 42 pen.
Gretna: Fleming, Hall, Collin (Barr 22), Innes, Naughton, Griffiths (Meynell 59), Murray (Wilkinson 77), Skelton, Buscher, Deuchar, Kissock. Subs Not Used: Krysiak, McGill, Deverdics, Makinwa.
Sent Off: Hall (65).
Booked: Hall, Meynell, Naughton.
Ref: C Richmond