A Luis Suarez strike two minutes from time squeezed Liverpool into the group stage of the Europa League.
Hearts had led for three minutes thanks to a David Templeton strike that was spilled into his net by Pepe Reina.
But they could not hold out for extra-time as Suarez eventually notched the goal he had been threatening all match.
Hearts, though, will return to Edinburgh full of pride at their performance over the two legs.
Similar to the first leg, Hearts had plenty of early possession but they were carved open and almost fell behind after 14 minutes.
Jamie Carragher released Stewart Downing down the left and his deep cross was headed back across goal by Steven Gerrard. The lurking Suarez's subsequent header looked goal-bound but Marius Zaliukas got back to sweep the ball off the line.
Despite their status as massive underdogs, Hearts looked composed and a flowing move ended with Mehdi Taouil sending a shot tamely into the arms of Reina.
The visitors then had a decent claim for a penalty turned down when Callum Paterson tumbled under Carragher's challenge before Liverpool began to turn up the heat.
Adam Morgan's powerful effort from 25 yards was spilled by Jamie MacDonald but, with Gerrard bearing down on him, the keeper recovered to dive on the ball.
The Hearts man did even better on the half-hour mark as he rushed off his line to save from Gerrard, who had waltzed through three challenges on his way into the box.
Liverpool thought they had taken the lead shortly afterwards as Morgan tapped into an empty net, only for the assistant referee to indicate Suarez had carried the ball out of play before cutting it back.
Templeton was looking like Hearts' most threatening player, but he should have done better than hit high and wide when the ball dropped kindly for him 25 yards from goal just before the break.
Liverpool started the second half at a high tempo and carved out an early opportunity for Jonjo Shelvey, who rifled the ball just off target from outside the box.
Hearts had defended superbly for the first hour but, as slackness began to creep in, Liverpool threatened to punish them.
Suarez rounded MacDonald after beating the Hearts offside trap but Ryan McGowan did brilliantly to get back and block the shot on the line.
Moments later Arvydas Novikovas lost out to Shelvey, allowing Suarez to turn and shoot, but once again his effort flew just wide, as did a ferociously whipped shot from Gerrard as the match entered the final quarter.
The pace and alertness of Suarez continued to cause problems in the Hearts backline and only evasive action from MacDonald prevented the Uruguayan profiting from another throughball, before the keeper used a leg to deny Gerrard at his near post.
Hearts chances by this stage were few and far between, so when Taouil was wasteful from just outside the box, the groans from the visitors' end were keenly felt.
But that anguish turned to rapturous joy five minutes from time when Templeton's speculative attempt from 25 yards squirmed from the grasp of the embarrassed Reina.
Suarez spared his keeper's blushes, though, when he raced clear three minutes later, evaded the challenge of Zaliukas and beat MacDonald from a narrow angle to send his side into the group stage of the Europa League.
Liverpool manager Brendan Rodgers:
"We achieved the objective which was to get through. They were two very tough games and they were never going to be easy.
"I thought the attitude and commitment of the players was excellent. We showed our spirit towards the end when we went behind. Our spirit really came through.
"I thought we were wasteful. We created chances and could have put the game to bed a lot earlier, but the most important thing was to get through and we have done that."
- 25 Reina
- 23 Carragher
- 34 Kelly
- 37 Skrtel
- 08 Gerrard
- 14 Henderson (Borini - 76' )
- 19 Downing
- 24 Allen
- 33 Shelvey
- 07 Suarez
- 50 Morgan (Sterling - 62' )
- 01 Jones
- 02 Johnson
- 03 Jose Enrique
- 05 Agger
- 16 Coates
- 31 Sterling
- 29 Borini
Heart of Midlothian
- 01 MacDonald
- 03 Grainger Booked
- 04 McGowan
- 05 Barr Booked
- 06 Webster
- 26 Zaliukas
- 33 Paterson
- 07 Templeton
- 10 Taouil
- 09 Sutton (Driver - 66' )
- 18 Novikovas (Carrick - 75' )
- 31 Hamilton
- 19 McGowan
- 29 McHattie
- 11 Driver
- 15 Holt
- 08 Robinson
- 37 Carrick
Live Text Commentary
Full Time The final whistle goes and the game is over.90:00 +1:23
Short corner taken by Luis Suarez.90:00 +1:16
Steven Gerrard delivers the ball, clearance by Andy Webster.90:00 +0:09
Free kick awarded for a foul by Andy Webster on Luis Suarez. Luis Suarez restarts play with the free kick.87:23
The assist for the goal came from Steven Gerrard.87:23 Goal scored
Goal! - Luis Suarez - Liverpool 1 - 1 Hearts Luis Suarez fires in a goal from inside the area to the bottom right corner of the goal. Liverpool 1 (2)-(1) 1 Hearts.85:21
Steven Gerrard crosses the ball in from the free kick, Andy Webster makes a clearance.85:21 Booking
Booking Daniel Grainger receives a yellow card.85:15
Foul by Daniel Grainger on Raheem Sterling, free kick awarded.84:03 Goal scored
Goal! - David Templeton - Liverpool 0 - 1 Hearts A goal is scored by David Templeton from outside the box to the bottom left corner of the goal. Liverpool 0 (1)-(1) 1 Hearts.83:32
Corner taken by Andrew Driver from the left by-line, Jonjo Shelvey makes a clearance.82:30
Unfair challenge on David Templeton by Raheem Sterling results in a free kick. Strike comes in from Daniel Grainger from the free kick.81:05
Steven Gerrard delivers the ball.80:33
Jamie Carragher restarts play with the free kick.80:33 Booking
Booking Darren Barr is cautioned by the ref for unsporting behaviour.80:17
Darren Barr gives away a free kick for an unfair challenge on Joe Allen.79:08
Mehdi Taouil produces a right-footed shot from just outside the area that goes harmlessly over the target.76:22
The referee penalises Dale Carrick for handball. Jose Reina takes the direct free kick.74:40
Indirect free kick taken by Jamie MacDonald.74:40 Substitution
Substitution Fabio Borini replaces Jordan Henderson.
Substitution Dale Carrick on for Arvydas Novikovas.74:40
Martin Skrtel is caught offside.74:14
Short corner worked by Steven Gerrard.74:02
Raheem Sterling takes a shot. Blocked by Daniel Grainger.73:25
Unfair challenge on Jordan Henderson by Andrew Driver results in a free kick. Free kick taken by Jordan Henderson.71:20
Outswinging corner taken right-footed by Steven Gerrard from the right by-line, clearance by Ryan McGowan.71:06
Steven Gerrard takes a shot. Jamie MacDonald makes a save.70:31
Luis Suarez concedes a free kick for a foul on Jamie MacDonald. Indirect free kick taken by Jamie MacDonald.68:08
Effort from a long way out by Steven Gerrard goes wide right of the target.67:57
Raheem Sterling sends in a cross, Ryan McGowan manages to make a clearance.66:17
Martin Kelly produces a cross, Marius Zaliukas makes a clearance.65:03 Substitution
Substitution Andrew Driver comes on in place of John Sutton.65:03
Effort from outside the penalty box by Raheem Sterling goes wide left of the target.64:11
Shot by Luis Suarez from deep inside the penalty area misses to the left of the target.63:33
Jonjo Shelvey takes a outswinging corner from the right by-line to the near post, Callum Paterson manages to make a clearance.63:23
Luis Suarez takes a shot. Blocked by Andy Webster.62:34
Steven Gerrard takes a shot. Daniel Grainger gets a block in. Raheem Sterling sends in a cross, Jamie MacDonald makes a save.60:50
Indirect free kick taken by Jamie MacDonald.60:50 Substitution
Substitution Raheem Sterling joins the action as a substitute, replacing Adam Morgan.60:50
Luis Suarez concedes a free kick for a foul on Jamie MacDonald.60:13
Centre by Arvydas Novikovas, Stewart Downing makes a clearance.59:07
Outswinging corner taken right-footed by Steven Gerrard, Martin Skrtel produces a header from the edge of the box and misses to the left of the target.58:33
Outswinging corner taken right-footed by Steven Gerrard played to the near post, clearance made by Daniel Grainger.57:21
The ball is sent over by Stewart Downing.56:16
The ball is crossed by Stewart Downing, clearance by Daniel Grainger.54:59
Jordan Henderson takes a shot. Darren Barr gets a block in.54:12
Ryan McGowan delivers the ball.53:19
Free kick awarded for a foul by Jordan Henderson on David Templeton. Indirect free kick taken by Andy Webster.52:13
Adam Morgan is caught offside. Jamie MacDonald takes the indirect free kick.52:00
The ball is swung over by Stewart Downing, Marius Zaliukas manages to make a clearance.50:48
Jonjo Shelvey has an effort at goal from outside the area which goes wide left of the target.49:32
Jonjo Shelvey takes a shot. Marius Zaliukas gets a block in.49:03
Outswinging corner taken right-footed by Steven Gerrard played to the near post, clearance made by Callum Paterson.48:39
Corner taken by Steven Gerrard from the right by-line to the near post, Andy Webster manages to make a clearance.47:17
Unfair challenge on Darren Barr by Jordan Henderson results in a free kick. Free kick taken by Jamie MacDonald.45:01
The referee blows his whistle to start the second half.45:00 +0:04 Half time
Half Time The ref blows to signal half-time.44:27
Callum Paterson concedes a free kick for a foul on Jamie Carragher. Jamie Carragher takes the free kick.43:59
Luis Suarez is flagged offside by the assistant referee. Direct free kick taken by Jamie MacDonald.41:50
Free kick awarded for a foul by Jamie Carragher on Daniel Grainger. Free kick crossed by David Templeton, Jonjo Shelvey manages to make a clearance.40:58
Outswinging corner taken right-footed by Steven Gerrard from the right by-line, Ryan McGowan makes a clearance.40:51
Martin Kelly produces a cross, Daniel Grainger gets a block in.39:34
David Templeton has shot on goal from just outside the box which goes wide of the right-hand upright.37:31
The ball is swung over by David Templeton, save by Jose Reina.34:44
David Templeton sends in a cross, Header by John Sutton from deep inside the penalty area misses to the left of the goal.33:55
Unfair challenge on Steven Gerrard by Darren Barr results in a free kick. Free kick taken by Jose Reina.31:08
David Templeton takes a shot. Blocked by Martin Skrtel.29:23
Steven Gerrard takes a shot. Save by Jamie MacDonald.26:56
Foul by Jamie Carragher on John Sutton, free kick awarded. David Templeton crosses the ball from the free kick right-footed from left channel, Andy Webster challenges Jamie Carragher unfairly and gives away a free kick. Jose Reina restarts play with the free kick.26:29
Shot from 25 yards from Adam Morgan. Save by Jamie MacDonald.26:05
Shot from just outside the box by John Sutton goes over the bar.24:54
Luis Suarez gives away a free kick for an unfair challenge on Daniel Grainger. Daniel Grainger takes the direct free kick.23:08
The ball is sent over by Martin Kelly.22:47
Ryan McGowan challenges Jordan Henderson unfairly and gives away a free kick. Jonjo Shelvey takes the free kick.22:20
Steven Gerrard takes a shot. Blocked by Marius Zaliukas.20:06
Free kick awarded for an unfair challenge on Joe Allen by John Sutton. Free kick taken by Martin Skrtel.19:38
Free kick awarded for a foul by Martin Kelly on Marius Zaliukas. Free kick taken by Jamie MacDonald.19:15
Arvydas Novikovas crosses the ball, Mehdi Taouil takes a shot. Jose Reina makes a comfortable save.15:41
The ball is swung over by Ryan McGowan.15:09
Adam Morgan challenges Callum Paterson unfairly and gives away a free kick. Free kick taken by Daniel Grainger.14:41
A cross is delivered by Jonjo Shelvey, clearance by Callum Paterson.14:24
Inswinging corner taken by Steven Gerrard from the left by-line, save by Jamie MacDonald.13:58
The ball is sent over by Stewart Downing, Luis Suarez takes a shot. Blocked by Marius Zaliukas.13:09
The assistant referee signals for offside against Adam Morgan. Jamie MacDonald takes the direct free kick.9:50
Arvydas Novikovas produces a cross.8:55
The ball is sent over by Stewart Downing.7:35
The ball is swung over by Daniel Grainger, Jonjo Shelvey manages to make a clearance.7:25
David Templeton delivers the ball, Martin Kelly gets a block in.6:11
Foul by Adam Morgan on Arvydas Novikovas, free kick awarded. Free kick taken by Daniel Grainger.5:03
Corner taken right-footed by Steven Gerrard to the near post, Callum Paterson manages to make a clearance.4:53
Luis Suarez takes a shot. Marius Zaliukas gets a block in.4:14
Callum Paterson has an effort at goal from outside the box which goes wide left of the target.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers