ABERDEEN were within two minutes of a ninth visit to Hampden over the past four years.

One late Hearts equaliser and a penalty shoot-out defeat later and the Pittodrie club’s season has taken an unfortunate downward turn. Good job it’s Ibrox on Sunday then.

Aberdeen should have beaten Hearts and made it to the Betfred Cup semi-final, where they will play their old friends who host them at the weekend.

Derek McInnes’s squad has changed several times but one thing has been a constant. They reach semi-finals and finals. Sunday, when they face Rangers, is a going be a huge test of character.

READ MORE: Crisis...what crisis? Hearts have managed to turn around their season

"We have another massive game on Saturday so we have not got time to sulk or to be too focused on this defeat,” said Joe Lewis, the Aberdeen captain. “The game against Rangers is a big game for the club and we are now going to have to get straight on to that.

“I’m sure that this evening and probably tomorrow morning, when the lads wake up, we will all still be disappointed about this game but we will recover and make sure we are fully focused on Saturday’s game. We don’t have time to dwell on this.”

Aberdeen were the masters of the own downfall in Gorgie.

Hearts' first goal came from a horrendous and untypical Mikey Devlin mistake, they failed to defend the last cross of the 90 minutes and then, and this was something to see, missed three out of three penalties in the shoot-out.

Pick the bones out of that.

Lewis said: "You look at individual things. Mikey has slipped at the first one and that leaves (Steven) MacLean loads of time to put it in the bottom corner. That was a disappointing one from Mikey’s point of view and then, for the second one, their centre half has gambled and made his surge into the box and we haven’t picked him up.

"I think we played well and at times really well in phases and deservedly got our two penalties. I don’t think it was poor decisions or a bit of luck, they were both clear cut chances or would have been if our players hadn’t been brought down so i don’t think we can be too disappointed with the performance overall but in cup football it is all about getting through and we didn’t do that."

Glasgow Times:

READ MORE: Rangers captain James Tavernier insists he can handle penalty pressure

Sam Cosgrove scored two goals from the 12 yard spot in the first-half at Tynecastle and then almost put his spot-kick in the shoot-out over the Gorgie Stand.

Lewis said: "Sam doesn’t need to beat himself up because he scored two in the game and he has scored plenty other penalties for us this season and in previous season.

"The lads had the courage to step up and take the penalties and unfortunately we didn’t score any but that is what penalty shootouts are all about and someone misses so hopefully the lads don’t get too disappointed with themselves.

"They were the ones who had the courage to step up but unfortunately this time around they didn’t score."