There was agony in Aberdeen for Dunfermline as a disastrous own goal in the 91st minute sent them crashing out of the Scottish Cup.
Last-gasp winnerAberdeen midfielder Paul Hartley added, “It was a relief to get the goal because we did not want to go to a replay. We are fed up hearing about all the teams who have beat Aberdeen in the cup.
“There has been a change this season and we’ve had the mentality to get through these games.”
The Pars handed a debut to St Johnstone loan signing Kevin Rutkiewicz, who partnered Alex Keddie in central defence, while there was a first start for Aberdeen left-back Steven Smith.
The visitors were hoping to repeat the feat of 2009, when they knocked the Dons out at the quarter-final stage on penalties, while the home side were striving to avoid going out to yet another lower league side in cup competition.
Dunfermline had the first chance of the game on six minutes but striker Andy Kirk, usually so deadly in front of goal, pulled his shot across the face and past the far post from just a few yards out.
The Dons were forced to make a switch just a couple of minutes later, Derek Young replacing the injured Rob Milsom.
With quarter of an hour gone, they had their first decent move of the match, with a Paul Hartley pass well controlled by Scott Vernon, who poked the ball over the bar.
Vernon tried his luck again, first missing with a header off a Rory McArdle cross, then forcing keeper Allison into a save after connecting with a delivery from Maguire.
Allison’s hands were stinging on 34 minutes, when he had to stop a ferocious drive from Aberdeen’s Ryan Jack, then on the stroke of half-time Vernon nodded over again, this time from a Steven Smith corner.
The travelling fans were in boisterous mood and good voice but they held their collective breath on 51 minutes when Dons striker Nick Blackman fired in a low shot that went close.
Blackman only lasted five minutes more, though, going off injured to be replaced by Peter Pawlett.
The game badly needed a spark and Maguire, who had been lucky to avoid a card after lashing out at Keddie, did his best to provide it on 65 minutes, blasting the ball in from 25 yards and about a foot over the bar.
On 69 minutes, the Pars struck back, striker Pat Clarke driving upfield before playing in Kirk, whose shot had to be palmed away by Aberdeen goalie Jamie Langfield.
The Pars made a couple of changes, giving Nick Phinn a run out and taking off Alex Burke, then bringing on McGregor for Rutkiewicz, while the hosts withdrew Ryan Jack for and put on Josh Magennis.
Aberdeen defender Zander Diamond sent a header just past the upright as the game entered its latter stages, then in stoppage time Vernon fired past the post when found by a flick from Maguire.
The Pars launched a counter-attack, with sub Phinn running forward before send a drive wide.
Then came the last-gasp winner for the Dons, with Maguire driving the ball in, Allison punching the ball out only for it to strike the luckless McGregor and spin into the net.
Attendance5636.
AberdeenLangfield, McArdle, Diamond, Maguire, Hartley, Vernon, Vujadinovic, Smith, Jack (Magennis 81), Blackman (Pawlett 56), Milsom (Young 8). Subs not used-Howard, Paton.
DunfermlineAllison, Woods, McCann, Mason, Rutkiewicz (McGregor 80), Keddie, Graham, Burke (Phinn 77), Clarke, Kirk, Cardle (Thomson 88). Subs not used-Paterson, Willis.
RefereeWillie Collum.
Heading for what would have been a deserved draw and a lucrative replay back at East End Park, they failed to deal with a Chris Maguire cross and keeper Kyle Allison punched it on to his defender Neil McGregor and into the net.
The visitors sank to the Pittodrie turf and their fans, who had added noise and colour to a low-key affair, stood stunned as the Dons celebrated reaching the quarter-finals, where they will play St Mirren in Paisley.
“I am absolutely gutted,” said Pars boss Jim McIntyre.
“I thought the players were excellent today, I really did.
“We stuck to our shape well and created a couple of really good goalscoring opportunities. My only criticism is that we did not hit the target.
“Neil had gone on and did really well and had some great blocks.
“It was a dangerous ball into the box, the keeper has got a hand to it and it has cannoned off his (McGregor’s) knee and gone in.
“It is a real cruel game at times and we did not deserve that. The least we deserved was a replay.
“I couldn’t be prouder of the boys because they came here and showed they can handle playing at this level.
“What we need to do is kick on in the league so we can hope to come to places like this more regularly.”
Dons boss Craig Brown felt sorry for the Pars despite being delighted to be in the last eight.
“I have genuine sympathy for Dunfermline,” he said.
“We were bombarding their box and there were incessant attacks. We have had a lot of misfortune in recent matches.
“We have played Celtic three times and not got one break so if we got a break today then I think it was long overdue.”