Anthony McDonald scored twice in a 2-1 win over Partick Thistle as Hearts progressed to the next round of the Reserve League Cup by topping Group C.
McDonald gave the Jambos a second-half lead at Oriam, firing home a right-footed shot.
With 15 minutes left, Aidan Fitzpatrick levelled the tie with a stunning strike.
Thistle were reduced to ten men when Max Melbourne was red-carded for violent conduct.
McDonald won the tie for Hearts in injury time, slamming the ball home from six yards.
Hearts: Mason, Logan, Gajda (Strang, 86), Petkov, Hickey (Zanatta, 66), Ritchie, McGill, McDonald, Smith, Moore, Makovora (Henderson, 57). Subs: Silva, Leddie.