Celtic goalkeeper Joe Hart set himself up for a Scottish Gas Scottish Cup final farewell – despite missing a penalty in a shoot-out in a Hampden classic against Aberdeen.

Hart hit the post with Celtic’s fifth penalty following a thrilling 3-3 draw with the Dons but the victory was only delayed. The 36-year-old saved from Killian Phillips to ensure a 6-5 shoot-out win and a final date on May 25 against Rangers or Hearts ahead of his impending retirement.

It was a semi-final that had just about everything. Celtic recovered from Bojan Miovski’s early goal to led through goals from Nicolas Kuhn and substitute James Forrest, but substitute Ester Sokler headed home at the back post in the 90th minute.

Matt O’Riley fired Celtic ahead in extra-time but stand-in Dons captain Angus MacDonald atoned for the massive blunder that led to Celtic’s equaliser when he headed home in the 119th minute.

The shoot-out somehow surpassed the drama of the actual game as Hart took centre stage.

Brendan Rodgers has enjoyed far more straightforward afternoons at Hampden but still earned a perfect 10th victory at the national stadium in his first game here since the League Cup final in December 2018.

The Dons stunned the favourites two minutes in. Leighton Clarkson played a perfect pass inside Cameron Carter-Vickers to get Miovski in behind and the North Macedonia striker beat Hart to claim his 24th goal of the campaign.

Celtic created two half-chances to equalise but Yang Hyun-jun headed over and Kelle Roos stood up to parry Kyogo Furuhashi’s effort.

Aberdeen were otherwise keeping Celtic at bay until MacDonald took a poor second touch on the ball midway inside his half in the 21st minute. Furuhashi to raced away before his effort was blocked by Stefan Gartenmann, but the ball fell kindly for Kuhn, who rolled it past a stranded Roos.

Aberdeen had the best opportunity to take an interval lead but Hart saved from Gartenmann and Celtic had a let-off in the closing stages of the half when Scales handled just outside the box, according to a VAR check.

Rodgers made his first changes in the 62nd minute, Callum McGregor replaced by Tomoki Iwata and Yang making way for Forrest. The 32-year-old had a shot blocked even before netting 90 seconds after coming on.

The winger dropped the shoulder to cut inside his man before curling a perfect shot just inside the far post from 23 yards. It was his ninth goal in the latter stages of cup competitions.

Forrest forced Roos into a diving save but the game changed with the introduction of a second Aberdeen striker, Sokler, in the 79th minute.

Aerial balls led to two excellent chances for another substitute, Junior Hoilett, but a poor first touch saw him miss the first and Carter-Vickers blocked on the line from the second opportunity.

Scales headed over from six yards and Celtic paid the price for a poor pass forward from substitute Luis Palma. The ball was worked to Hoilett, who crossed to the back post for Sokler to head home.

Sokler stabbed wide in the opening moments of extra-time, although he would possibly have been called offside if it had gone to VAR, and Celtic got back on top before taking the lead in stoppage-time of the first period.

Forrest threaded a pass that allowed Alistair Johnston to run in behind and cut back for O’Riley, who found the top corner from eight yards.

The drama continued. Adam Idah had a headed goal disallowed for offside before failing to turn O’Riley’s square ball home.

Celtic survived another VAR penalty check after Carter-Vickers caught Hoilett, the video officials backing referee Don Robertson’s view that the Aberdeen winger had committed a foul on Johnston seconds beforehand.

Sokler missed from close range before MacDonald headed home in a near carbon copy of Sokler’s equaliser to spark wild celebrations on the trackside between players and fans.

Even the shoot-out had some outrageous twists. The first seven penalties were scored before Roos went down with apparent cramp and needed treatment. Ryan Duncan hit the post after the long delay.

The Celtic fans got a shock when Hart stepped up to take the penalty that would have sent Celtic into the final. The goalkeeper also hit the post.

Hoilett netted to send the tie into sudden death but Hart had the final say.