Jamie Brandon played 45 minutes as Hearts beat Dunfermline 1-0 in a SPFL Reserve League clash in Kelty.
The 20-year-old right-back was making his first appearance since suffering a ruptured anterior cruciate ligament in a Development League match against Aberdeen in February.
Hearts took all three points at New Central Park thanks to a last-gasp goal by substitute Rory Currie.
The Jam Tarts had a lucky escape on 11 minutes when Dunfermline were awarded a penalty, Kalum Higginbotham sending his effort high over the ball.
The visitors had the chance to take the lead 12 minutes after half-time when Alex Petkov was bundled over in the box. However, Danish winger Danny Amankwaa’s spot-kick was saved by Cammy Gill.
Hearts continued to press and came close to breaking the deadlock through Euan Henderson and Leeroy Makovora.
Dunfermline’s Lewis McCann was red-carded on 71 minutes for a late challenge on Petkov.
Hearts midfielde Connor Smith rifled a 25-yard effort off the bar with four minutes remaining.
The visitors weren’t to be denied, though, as Amankwaa fired the ball across goal in the final minute for Currie to touch home.
Hearts: Silva, Brandon, Hickey, Logan, Hamilton, Petkov, C Smith, Ritchie, Makovora, Henderson, Amankwaa.