Naby Keita broke deadlock with a rising 25-yard drive, and they added further goals before the break through Trent Alexander-Arnold’s fine free-kick and Gini Wijnaldum’s close-range strike.
Olivier Giroud scrambled in for Chelsea on the stroke of half-time but their hopes of a comeback appeared to be snuffed out 10 minutes after the break, when Roberto Firmino headed in his first Premier League home goal of the season from Alexander-Arnold’s cross.
Chelsea substitute Christian Pulisic then had a dramatic impact as he sparked a Chelsea fightback, creating a goal for Tammy Abraham and then scoring another himself on the turn as this entertaining game took an unexpected turn.
To the thunderous sound of fireworks being let off outside Anfield by celebrating fans, the champions pressed forward again and Alex Oxlade-Chamberlain slammed home the fifth from Andy Robertson’s cross with six minutes left.
Chelsea now need a point from their final game at home to Wolves on Sunday to confirm a place in the top four and next season’s Champions League.
Liverpool XI: Wijnaldum, Alisson, Firmino, Salah, Van Dijk, Mane, Fabinho, Robertson, Joe Gomez, Naby Keita, Alexander-Arnold
Subs: Milner, Lallana, Lovren, Adrian, Shaqiri, Oxlade-Chamberlain, Minamino, Origi, Curtis Jones
Chelsea XI: Willian, Azpilicueta, Giroud, Alonso, Kovacic, Zouma, Jorginho, Rudiger, Kepa, Mount, Reece James
Subs: Caballero, Pedro, Emerson, Christensen, Loftus-Cheek, Tomori, Abraham, Pulisic, Hudson-Odoi