Ayr 1-1 Hearts (4-1 pens)
Bottom of Division One Ayr United knocked Scottish Premier League Hearts out of the Scottish Communities League Cup after triumphing on penalties.
Scott Robinson fired the visitors in front with a 49th-minute strike.
But Gareth Wardlaw levelled for Ayr on 63 minutes and neither side could find a winner in extra time.
Danny Grainger's penalty was saved by Ayr's Kevin Cuthbert and Hearts' Rudi Skacel missed his spot-kick, allowing Mark Roberts to send Ayr through.
The win at Somerset Park was the second time Brian Reid's side had beaten SPL competition in the Cup, having eliminated Inverness in the previous round .
Paulo Sergio made eight changes to the Hearts side that beat St Mirren in the SPL on Saturday. They started the brighter and would have taken the lead had Cuthbert not saved superbly from a John Sutton header.
Ayr's Michael Moffat fired in a dangerous delivery for Wardlaw, who headed inches over the top with Janos Balogh in the Hearts goal in no man's land.
Hearts were quick out of the traps at the beginning of the second half and they grabbed the lead on 49 minutes.
Grainger's corner was headed only as far as Robinson, who drove the ball low beyond Cuthbert and into the bottom-left corner of the goal.
Ayr almost hit back immediately when Ryan McGowan's cross evaded everyone in the penalty area but Eddie Malone was unable to convert at the back post.
Eggert Jonsson bundled a Grainger's set-piece over the line but referee Iain Brines decided no goal should be awarded as assistant referee Tom Murphy ruled the Icelandic defender had punched the ball into the net.
And two minutes later a slip by Marius Zaliukas 20 yards from his own goal allowed Wardlaw to drive through on goal and shoot past Balogh.
Hearts created chances through Templeton and Sutton but their opponents comfortably soaked up the pressure.
Neither team was able to create any further openings and the game moved into extra-time.
Ayr boss Brian Reid made an early change when play resumed - with Roberts on for Wardlaw.
With the exception of a long-range Grainger effort, Cuthbert was barely tested during the opening period.
The visitors raised the tempo in the opening stages of the second period forcing multiple corners and being denied by a number of match-saving blocks by Cuthbert, the pick of them coming from Ross Robertson after a stinging strike from Skacel.
Taking the kicks in front of the visiting support, Grainger and Skacel had their efforts kept out by Cuthbert while Moffat, Jamie McKernan, Alan Trouten and Roberts all successfully converted for Ayr to put them into the quarter-finals.
Ayr United manager Brian Reid: "The fitness and the effort of the players was second to none.
"It was an entertaining game and I am delighted to be through. The players deserve the plaudits tonight.
"I'm sure the other Premier League clubs will be taking notice and will be well aware of what to expect down here.
"[For the draw] As a manager, in terms of football progression, you want a so-called easier team here with home advantage.
"From the club's perspective, I'm sure they would rather have one of the big clubs for making money."
Hearts manager Paulo Sergio: "I think Hearts did more than enough to deserve to win the game today. It was Hearts who looked to score and we created a lot of chances to do it.
"We scored two clean goals but only one was good. I think that was a mistake.
"I spoke to the ref and he told me the linesman said it was a hand ball.
"I have to ask why the linesman was running to the middle of the pitch, giving the goal, if he saw a hand ball? I can't understand that.
"Hearts deserved to go through in the competition."
Sorry, we were unable to load match stats, please try again.