Barnsley sent Liverpool crashing out of the FA Cup thanks to Brian Howard's dramatic injury-time winner at Anfield.
Ryan Babel set up Dirk Kuyt to put the Reds ahead and only some super saves by Luke Steele kept Barnsley in the game.
The Tykes levelled when Stephen Foster headed home Martin Devaney's cross and, although Liverpool poured forward, they could not beat Steele on his debut.
Harry Kewell hit the bar for the home side before Howard's low shot into the bottom corner won it for Barnsley.
Liverpool had already been held by Luton Town of League One in the Cup this season and also had to come from behind twice against non-league Havant & Waterlooville in the previous round.
But the way Rafa Benitez's men started this game did not suggest they would suffer any sort of shock result against Simon Davey's side, who are in the bottom half of the Championship.
The home side had all the early possession and Peter Crouch forced an early save out of Steele after Yossi Benayoun had teed him up in the area.
Steele, only signed on an emergency loan from West Brom on Thursday because Barnsley's other keepers were injured or ineligible, was fast becoming a thorn in Liverpool's side.
He made two more stops in quick succession, saving acrobatically from Xabi Alonso and collecting Babel's low shot.
The former Manchester United goalkeeper was finally beaten on 32 minutes when Babel pulled the ball back for Kuyt, who took a touch before burying his shot into the back of the net.
But Steele also did brilliantly to keep out a Crouch header on the stroke of half-time and Barnsley capitalised when they equalised out of nowhere after the interval.
Devaney produced the cross of his life from out wide on the right and Foster rose highest to nod the ball past the flailing figure of Charles Itandje, who could only help it into the net.
The Barnsley defence was soon back under pressure with Bobby Hassell and Foster clearing a Benayoun shot off the line before Howard's block kept out Crouch's follow-up.
And Liverpool threw everything at the visitors, forcing Steele into another smart stop from Benayoun before he tipped a Lucas header on to the bar.
There was drama at the other end too when Itandje somehow escaped without being penalised after colliding with Kayode Odejayi as he chased down a long ball on the edge of the Liverpool penalty area.
But Liverpool were still looking like the only winners and the visitors were defending desperately when Kewell saw his rasping shot hit the bar late on.
There was still time for one last Barnsley attack, however, and Howard made it count.
The Tykes captain felt he should have had a penalty after being caught by Sami Hypia but picked himself up to collect the ball on the edge of the area before firing into the bottom corner to clinch a famous victory.
Liverpool: Itandje, Finnan, Carragher, Hyypia, Riise, Benayoun, Lucas (Gerrard 75), Alonso, Babel (Kewell 69), Kuyt, Crouch. Subs Not Used: Martin, Pennant, Arbeloa.
Booked: Alonso, Carragher.
Goals: Kuyt 32.
Barnsley: Steele, Hassell, Souza, Foster, Kozluk (Van Homoet 60), Devaney, De Silva, Howard, Leon (Campbell-Ryce 71), Ferenczi, Nardiello (Odejayi 55). Subs Not Used: Coulson, Togwell.
Booked: Van Homoet.
Goals: Foster 57, Howard 90.
Ref: Martin Atkinson (W Yorkshire).
BBC Sport Player Rater man of the match: Barnsley's Luke Steele 8.55 (on 90 minutes).