A third-minute Callum Paterson goal for Hearts dumped Aberdeen out of the Scottish Cup at Tynecastle.
Paterson headed home from close-range and it proved the pivotal moment of an absorbing cup tie.
The Dons spurned a wonderful opportunity to level midway through the second half when Andrew Considine scooped over from six yards.
In a frantic finale, Aberdeen pushed desperately, piling everybody forward, including goalkeeper, Danny Ward.
Niall McGinn and Ash Taylor had chances during those closing moments but could not execute.
The winner had its origins in a corner, a source of heavy vulnerability for Aberdeen throughout an opening half that Hearts bossed.
You did not need to hear what Aberdeen boss Derek McInnes was saying to know of his horror at watching that early, and ultimately decisive, blow. It was written all over his death stare at his defenders.
Sam Nicholson swung in a corner, Alim Ozturk got the first header and then Paterson got the critical second.
Aberdeen were crazily passive in that moment. For them, it was the ugliest of goals. For Hearts, it was a thing of infinite beauty - their first Scottish Cup goal since Rudi Skacel completed the rout of Hibernian in that tumultuous final of 2012.
Three-and-a-half years is a hell of a wait for a goal, but the way the home team set about the Dons in the minutes after Paterson scored it looked probable that a second was going to arrive in quick order.
They had their visitors surrounded. They hassled and harried them. They put them on the back foot and kept them there for long periods.
Hearts won a succession of corners in that opening spell and from so many of them the Dons had a desperate anxiety.
Blazej Augustyn put one in the side-netting midway through the half, then the defender had a free header, from another corner, and failed to put it away. Aberdeen were alive, but they were offering nothing.
The Dons have too many dangerous players for this torpor to last the entire night, though.
Eventually they found something. Some urgency, some goal threat. Adam Rooney forced a save from Neil Alexander, the preamble to their golden chance.
Jonny Hayes created it from the left and it was Considine who was on the end of it. From the edge of the six-yard box, and directly in front of the visiting army of almost 3,500 fans, the big defender lofted his strike over the target.
Hearts came again and Osman Sow, an excellent handful that the Dons never got to grips with, fired three attempts on Ward's goal. One flashed by a post, just.
None of them were put away, but Hearts would not regret their profligacy. They are into the fifth round - deservedly.
Full Time Match ends, Heart of Midlothian 1, Aberdeen 0.
90:00 +4:35 Full timeFull Time Second Half ends, Heart of Midlothian 1, Aberdeen 0.
90:00 +4:19Corner, Aberdeen. Conceded by Billy King.
90:00 +4:03Attempt blocked. Shaleum Logan (Aberdeen) right footed shot from outside the box is blocked.
90:00 +3:19 BookingBooking Neil Alexander (Heart of Midlothian) is shown the yellow card.
90:00 +3:09Prince Buaben (Heart of Midlothian) wins a free kick in the attacking half.
90:00 +3:09Foul by Ash Taylor (Aberdeen).
90:00 +2:31 BookingBooking Callum Paterson (Heart of Midlothian) is shown the yellow card for a bad foul.
90:00 +2:09Foul by Callum Paterson (Heart of Midlothian).
90:00 +2:09Jonny Hayes (Aberdeen) wins a free kick on the left wing.
90:00 +1:17Attempt saved. Ash Taylor (Aberdeen) header from the centre of the box is saved in the top centre of the goal.
90:00 +0:58Corner, Aberdeen. Conceded by Jordan McGhee.
90:00 +0:15Igor Rossi (Heart of Midlothian) wins a free kick on the right wing.
90:00 +0:15 BookingBooking Peter Pawlett (Aberdeen) is shown the yellow card for a bad foul.
90:00 +0:15Foul by Peter Pawlett (Aberdeen).
89:52Attempt saved. Niall McGinn (Aberdeen) right footed shot from a difficult angle on the right is saved in the centre of the goal.
88:24Alim Ozturk (Heart of Midlothian) wins a free kick in the defensive half.
88:24Foul by David Goodwillie (Aberdeen).
87:52 SubstitutionSubstitution Substitution, Heart of Midlothian. Jordan McGhee replaces Osman Sow.
87:23Attempt missed. Niall McGinn (Aberdeen) right footed shot from a difficult angle on the left misses to the left.
Attempt blocked. Kenny McLean (Aberdeen) left footed shot from outside the box is blocked.
86:18 BookingBooking Alim Ozturk (Heart of Midlothian) is shown the yellow card.
85:56Foul by Blazej Augustyn (Heart of Midlothian).
85:56Peter Pawlett (Aberdeen) wins a free kick in the attacking half.
85:19Attempt saved. Adam Rooney (Aberdeen) header from the centre of the box is saved in the top left corner.
83:17Miguel Pallardó (Heart of Midlothian) wins a free kick in the defensive half.
83:17Foul by Adam Rooney (Aberdeen).
79:52Attempt saved. Kenny McLean (Aberdeen) left footed shot from outside the box is saved in the centre of the goal.
79:21 SubstitutionSubstitution Substitution, Heart of Midlothian. Juanma replaces Gavin Reilly.
78:54Foul by Blazej Augustyn (Heart of Midlothian).
78:54Peter Pawlett (Aberdeen) wins a free kick in the defensive half.
76:52Corner, Aberdeen. Conceded by Miguel Pallardó.
76:18Attempt saved. Osman Sow (Heart of Midlothian) left footed shot from outside the box is saved in the bottom left corner.
75:34Corner, Heart of Midlothian. Conceded by Mark Reynolds.
73:46Attempt missed. Osman Sow (Heart of Midlothian) left footed shot from the left side of the box misses to the right.
70:52 SubstitutionSubstitution Substitution, Aberdeen. David Goodwillie replaces Andrew Considine.
69:38 SubstitutionSubstitution Substitution, Heart of Midlothian. Billy King replaces Sam Nicholson because of an injury.
68:55Attempt saved. Osman Sow (Heart of Midlothian) left footed shot from the centre of the box is saved in the centre of the goal.
66:45Attempt missed. Andrew Considine (Aberdeen) left footed shot from the centre of the box is close, but misses to the left.
66:21Foul by Callum Paterson (Heart of Midlothian).
66:21Graeme Shinnie (Aberdeen) wins a free kick on the left wing.
65:10(Heart of Midlothian) wins a free kick in the attacking half.
65:10Foul by Adam Rooney (Aberdeen).
64:11Attempt saved. Adam Rooney (Aberdeen) left footed shot from the left side of the box is saved in the bottom left corner.
63:45Attempt missed. Arnaud Djoum (Heart of Midlothian) right footed shot from outside the box is high and wide to the left.
62:33Attempt blocked. Sam Nicholson (Heart of Midlothian) right footed shot from outside the box is blocked.
62:33Corner, Heart of Midlothian. Conceded by Ash Taylor.
58:34(Heart of Midlothian) wins a free kick in the attacking half.
58:34Foul by Andrew Considine (Aberdeen).
58:00Peter Pawlett (Aberdeen) wins a free kick in the defensive half.
57:59Foul by Blazej Augustyn (Heart of Midlothian).
56:54Attempt missed. Kenny McLean (Aberdeen) right footed shot from outside the box is high and wide to the right.
56:13Foul by Miguel Pallardó (Heart of Midlothian).
56:13Peter Pawlett (Aberdeen) wins a free kick in the attacking half.
52:37Sam Nicholson (Heart of Midlothian) wins a free kick in the defensive half.
52:37Foul by Kenny McLean (Aberdeen).
51:23Osman Sow (Heart of Midlothian) wins a free kick on the right wing.
51:23Foul by Andrew Considine (Aberdeen).
50:39Delay in match (Aberdeen).
48:40Arnaud Djoum (Heart of Midlothian) wins a free kick in the defensive half.
48:40Foul by Graeme Shinnie (Aberdeen).
46:36Foul by Prince Buaben (Heart of Midlothian).
46:36Peter Pawlett (Aberdeen) wins a free kick in the defensive half.
45:00Second Half begins Heart of Midlothian 1, Aberdeen 0.
45:00 +1:07 Half timeHalf Time First Half ends, Heart of Midlothian 1, Aberdeen 0.
42:52 BookingBooking Igor Rossi (Heart of Midlothian) is shown the yellow card.
42:52 BookingBooking Adam Rooney (Aberdeen) is shown the yellow card for a bad foul.
40:56Corner, Heart of Midlothian. Conceded by Shaleum Logan.
40:54Attempt blocked. Osman Sow (Heart of Midlothian) left footed shot from the left side of the box is blocked.
39:51Corner, Heart of Midlothian. Conceded by Niall McGinn.
37:21 SubstitutionSubstitution Substitution, Aberdeen. Peter Pawlett replaces Willo Flood because of an injury.
35:35Delay over. They are ready to continue.
34:25Attempt saved. Blazej Augustyn (Heart of Midlothian) header from the centre of the box is saved in the top centre of the goal.
34:02Corner, Heart of Midlothian. Conceded by Willo Flood.
33:45Corner, Heart of Midlothian. Conceded by Mark Reynolds.
33:21Attempt blocked. Alim Ozturk (Heart of Midlothian) left footed shot from the centre of the box is blocked.
32:45Corner, Heart of Midlothian. Conceded by Shaleum Logan.
29:45Attempt saved. Sam Nicholson (Heart of Midlothian) right footed shot from outside the box is saved in the top centre of the goal.
24:45Attempt saved. Arnaud Djoum (Heart of Midlothian) right footed shot from outside the box is saved in the centre of the goal.
24:45Corner, Heart of Midlothian. Conceded by Mark Reynolds.
21:56Foul by Osman Sow (Heart of Midlothian).
21:56Willo Flood (Aberdeen) wins a free kick on the left wing.
20:01Arnaud Djoum (Heart of Midlothian) wins a free kick in the attacking half.
20:01Foul by Adam Rooney (Aberdeen).
19:44Corner, Aberdeen. Conceded by Blazej Augustyn.
19:08Foul by Sam Nicholson (Heart of Midlothian).
19:08Shaleum Logan (Aberdeen) wins a free kick in the attacking half.
18:16Foul by Igor Rossi (Heart of Midlothian).
18:16Jonny Hayes (Aberdeen) wins a free kick in the defensive half.
17:51Attempt saved. Niall McGinn (Aberdeen) right footed shot from outside the box is saved in the top centre of the goal.
16:45 BookingBooking Miguel Pallardó (Heart of Midlothian) is shown the yellow card for a bad foul.
16:45Foul by Miguel Pallardó (Heart of Midlothian).
16:45Graeme Shinnie (Aberdeen) wins a free kick in the defensive half.
13:32Corner, Heart of Midlothian. Conceded by Shaleum Logan.
10:46Foul by Prince Buaben (Heart of Midlothian).
10:46Jonny Hayes (Aberdeen) wins a free kick in the defensive half.
10:08Attempt missed. Blazej Augustyn (Heart of Midlothian) right footed shot from a difficult angle and long range on the left is close, but misses to the left.
9:44Corner, Heart of Midlothian. Conceded by Mark Reynolds.
8:32Osman Sow (Heart of Midlothian) wins a free kick in the defensive half.
8:32 BookingBooking Mark Reynolds (Aberdeen) is shown the yellow card for a bad foul.
8:30Foul by Mark Reynolds (Aberdeen).
4:11Alim Ozturk (Heart of Midlothian) wins a free kick in the attacking half.
4:11Foul by Ash Taylor (Aberdeen).
2:11 Goal scoredGoal! Goal! Heart of Midlothian 1, Aberdeen 0. Callum Paterson (Heart of Midlothian) header from very close range to the top right corner.
1:40Corner, Heart of Midlothian. Conceded by Mark Reynolds.
0:00First Half begins.
0:00Lineups are announced and players are warming up.
Live data and text provided by our data suppliers