Liverpool and Everton appeared headed for an FA Cup replay, but Virgil van Dijk's late header off a corner kick sent the Reds through on the Dutchman's debut with the club.
The 230th Merseyside derby was a lively encounter, as debutant Virgil van Dijk scored a late winner and send Liverpool into the fourth round of the FA Cup at the expense of local rivals Everton.
The Reds took the lead courtesy of a James Milner penalty in the first half, but Gylfi Sigurdsson's equalizer appeared to be sending the game into a replay until a late Van Dijk header booked Liverpool's place in the next round.
There was very little to choose between the two sides in the early stages, with robust challenges littering the game and nothing in the way of clear-cut chances for either team.
Liverpool began to see more of the ball, although a tame James Milner volley was all the hosts mustered in the opening 25 minutes, while the visitors looked a threat on the counter-attack - especially on the right-hand side, with Yannick Bolasie delivering some dangerous crosses that failed to find an Everton head.
The four previous FA Cup meetings at Anfield had ended in a draw, with the opening 30 minutes doing little to suggest that run would come to an end, with Sadio Mane's wayward strike from distance summing up the half up to that point.
With 10 minutes of the half remaining, Bobby Madley awarded the Reds a controversial penalty after Mason Holgate was adjudged to have hauled down Adam Lallana inside the Everton penalty area. Captain for the night, Milner took responsibility and calmly stroked the ball down the center to give Jurgen Klopp's side the lead.
That goal seemed to light the spark for the game to come alive, and a clash between Mason Holgate and Roberto Firmino - which will come under heavy scrutiny in the coming days - only served to ramp up the tension before the referee's whistle brought an end to first half proceedings.
The Toffees looked to show more attacking intent after the restart as they searched for an equalizer, although it was Liverpool who went close early in the second half. Joe Gomez found himself in space from a corner, but the young defender failed to direct his header on target.
With the game becoming more open, chances were coming much more frequently for both sides. Lallana and Andrew Robertson went close for the Reds, while some unconvincing goalkeeping from Liverpool's Loris Karius would give Sam Allardyce's side some encouragement.
The £75m man Van Dijk almost doubled his side's lead, but his header was straight at Jordan Pickford, before Everton soon found a way back into the tie. Ademola Lookman's searing pace saw him break away on the counter before he played in Jagielka, who laid off to Sigurdsson on the edge of the area to confidently sweep the ball past a motionless Karius and make it all square.
Both sides were now in search of a crucial third goal of the tie and prevent an unwanted replay from taking place, and it was Liverpool and Van Dijk who provided it.
With five minutes remaining, the towering Dutchman met Alex Oxlade-Chamberlain's in-swinging corner ahead of Pickford and nod the ball into an unguarded net to mark his debut with a potential winner.
As time ticked towards the final whistle, Everton looked for another equalizer in the game to set up a replay at Goodison Park, but a wild Bolasie effort from distance was the final effort for Allardyce's men, as the referee's whistle sounded for full-time and see Liverpool book their place in the fourth round.