Rangers lifted the Scottish FA Youth Cup after their goalkeeper Liam Kelly scored the decisive penalty in a thrilling shoot-out at St Mirren Park.
The teams were level at 2-2 after 90 minutes and the score remained the same following extra time. They then matched each another's penalty tally after 10 attempts apiece.
At 7-7, Kelly struck then saved opposing goalie Jordan Millar's effort.
Millar had been at fault for Rangers' late equaliser as full-time beckoned.
Hearts, with new club head coach Robbie Neilson in charge in the dugout, had led 1-0 through Sam Nicholson.
He met Calum Paterson's cross at the back post and, although his headed attempt was saved, he reacted quickly to lash it over the line.
Greg Pascazio's deflected long-range shot evaded Millar to restore parity before Billy King made it 2-1 to Hearts, knocking home the rebound from Angus Beith's shot.
The Hearts fans in Paisley were preparing their full-time celebrations when a long ball in the dying moments was nodded over Millar and into the net from 18 yards by Craig Halkett.
And after 14 converted penalties from 20 attempts, it took the heroics of goalkeeper Kelly for Rangers to get their hands on the trophy.
Rangers: Kelly, Pascazio, Sinnamon, Halkett, Gasparotto, Telfer, Stoney, Murdoch, Gallagher, Dykes, Ramsay. Subs: Gibson, Roberts, Burrows, McKay, McMinn.
Hearts: Millar, Smith, Paterson, Gordon, McGhee, Beith, King, Scott, Carrick, Oliver, Nicholson. Subs: Buchanan, Mason, Simpson, Ford, McKirdy