Steven Gerrard smashed in a 90th-minute drive as Liverpool came from behind to beat Middlesbrough at Anfield.
Striker Mido came off the bench to put the visitors ahead with a low, 30-yard drive on 70 minutes and it seemed his side were heading for victory.
But Jamie Carragher's drive from the edge of the box flew in off Boro's Emmanuel Pogatetz to give Liverpool an equaliser 16 minutes later.
And in stoppage time, Gerrard lashed in an angled shot to snatch the points.
A combination of dogged defending and discipline had kept the home side at bay and when Mido put them in front they looked on their way to their first victory at Anfield for 23 years.
But a slice of bad luck and a lapse in concentration enabled Liverpool managed to make it back-to-back wins in their opening two Premier League games for the first time under manager Rafael Benitez.
Few would have predicted it after a first half which saw Liverpool struggle to break down their opponents and barely threaten young keeper Ross Turnbull, who was drafted in after Brad Jones was injured in the warm-up.
Turnbull comfortably beat away an early Dirk Kuyt drive, but was then helped out by a number of last-ditch tackles and blocks that frustrated Liverpool.
Robbie Keane mis-kicked from the edge of the box when should have done much better, while at the other end Boro's Andrew Taylor fizzed in a volley which was heading for the top corner until Pepe Reina tipped it over the bar.
After the break, the pattern was much the same, with Boro keeping their shape and trying to hit Liverpool on the counter-attack.
It looked like their their tactics were spot-on when Mido scored with a peach of a shot to put them in front.
Unsurprisingly, Boro then looked to sit back on their advantage and though Liverpool had more space in which to come forward, they did not look dangerous.
But then it all changed, and from an unexpected source, as Carragher tried his luck from the edge of the box and while his luck was good, Pogatez's was not and the ball flew in off the unfortunate defender.
With the scores level, it was inevitable that Boro were going to have to withstand a Liverpool assault in the final minutes to go home with anything from the game.
As time ran out, it seemed they had done enough but a long ball clipped over the top by Xabi Alonso broke to Gerrard and he arrowed a fierce shot into the top corner to snatch the win for his side.
Liverpool boss Rafael Benitez:"I was very pleased with the first 15 minutes, but after that we did not play well. Then they scored and we had to throw people forward.
Last season we drew far too many games at Anfield. But this time we have sent out a message that in such situations we can win the game. We have winners here."
Middlesbrough boss Gareth Southgate: "That was hard to take. The players are heartbroken in the dressing room. We deserved more, we certainly deserved a point.
"Their equaliser was a freak, and we should have been able to see out the game even at 1-1.
"But I have told them that they can leave Anfield with their heads high."
Liverpool: Reina, Arbeloa (El Zhar 83), Carragher, Skrtel, Dossena (Aurelio 75), Kuyt, Gerrard, Alonso, Benayoun (Babel 65), Keane, Torres.Subs Not Used: Cavalieri, Agger, Ngog, Plessis.
Booked: Arbeloa, Keane.
Goals: Pogatetz 86 og, Gerrard 90.
Middlesbrough: Turnbull, Wheater, Huth, Pogatetz, Taylor (Hoyte 75), Aliadiere, O'Neil, Shawky, Downing, Alves (Mido 60), Sanli (Digard 87).Subs Not Used: Emnes, Adam Johnson, Williams.
Goals: Mido 70.
Ref: Mike Riley (Yorkshire).
BBC Sport Player Rater man of the match: Liverpool's Torres 7.08 (on 90 minutes).