Oran Kearney bid an emotional farewell to Coleraine as the Bannsiders saw off Formartine United in the Irn-Bru Cup at The Showgrounds.
The hosts needed a penalty shoot-out to finally see off the Highland League side as the game finished 1-1 after 90 minutes.
Archie MacPhee gave the visitors a shock lead on 20 minutes before Josh Carson levelled things up in spectacular fashion on the half hour.
Eoin Bradley also saw a first half penalty saved following a foul on Aaron Burns.
The Bannsiders had the better of the second period without any real penetration, as Formartine defended resolutely, especially after being reduced to ten men late on following Graeme Rodger's dismissal.
So it was on to penalties and remarkably first five were all missed. Gareth McCoanghie and Bradley scored either side of Andrew Greig's successful spot kick for the visitors, before Conor Gethins dragged his effort wide to send Coleraine though.
The biggest cheer of the night though came as former boss Kearney took to the pitch at the end through a guard of honour with his children, Luca and Ava, as the Coleraine faithful wished him well ahead of his move to St Mirren.
It was an emotional goodbye for Kearney as he brought the curtain down on seven-and-a-half years on the Ballycastle Road.
The Bannsiders started well and should have taken the lead inside five minutes as Ciaron Harkin whipped a great ball into the box, both Bradley and Burns looked certain to score, but a visiting defender managed to push it away to safety.
Bradley then forced a save out of Kevin Main three minutes later, surging into the box before drilling a shot towards the near post, which the keeper did well to hold.
The Coleraine striker did have the ball in the net on 12 minutes, but it was quickly chalked off for offside.
The visitors edged in front on 20 minutes as the Bannsiders were punished for some slack defending.
Ryan Stott pounced on the loose ball squaring it for MacPhee to tap home from six yards.
The Highland League side were growing in confidence and almost doubled their advantage on 25 minutes.
Graeme Rodger had a shot blocked before Stott dragged the rebound wide of the far post.
The hosts drew level in spectacular style on 31 minutes. Josh Carson picked up the loose ball on the edge of the box and unleashed a dipping volley past the helpless Main.
Coleraine should have been in front four minutes later after Aaron Burns was upended in the box.
Bradley stepped up to take the spot kick, but Main got down well to palm it away.
MacPhee curled a shot over from distance four minutes after the restart after he lost his marker.
Gareth McConaghie drew a good save out of Main with a set piece from fully 30 yards after Gary Fraser had been punished for a foul on Lowry.
The keeper was called into action again on 72 minutes as Ian Parkhill tried his luck from distance, Main managed to push his dipping shot from 30 yards over the bar.
Formartine suffered a late blow as Rodger was sent sent off after picking up a second yellow for blocking Carson's drive with two minutes to go.
Right at the death Coleraine broke away down the right through Bradley, he cut inside and dorve a low cross-cum-shot towards goal, which evaded everyone and Main gratefully gathered.
So it was on to penalties and remarkably the first five spot kicks were all missed.
Stuart Anderson, Gary Fraser and Archie MacPhee all missed for the visitors, with Ian Parkhill and Josh Carson repeating the feat for the Bannsiders.
Gareth McConaghie netted the first penalty to put Coleraine in front. Andrew Greig levelled things up before before Bradley atoned for his earlier miss by putting his side in front.
So it was down to Conor Gethins, he had to score, but dragged his spot kick wide of the target.
Coleraine: Johns, Canning, Traynor, McConaghie, Crown, Harkin, Lowry, Carson, Parkhill, Bradley, Burns.
Subs: Mullan, Douglas, Gawne, Owens.
Formartine United: Main, Crawford (Burnett 63), Smith, S Anderson, J Anderson, MacPherson, Stott (Gethins 84), Rodger, Fraser MacPhee, Greig.
Subs: Whyte, MacDonald.
Referee: David Morgan