Mame Biram Diouf fired a quick double before Jonathan Walters, Charlie Adam and a Steven N’Zonzi thunderbolt put the hosts five in front at half-time.
Gerrard got on the scoresheet as he signed off with a goal in the second half, before Peter Crouch added a sixth to overtake Alan Shearer in the charts for most headed Premier League goals.
The big news before the game was the omission of Raheem Sterling from the starting line-up, after a contract row which culminated in the club cancelling scheduled talks with the 20-year-old.
Attention soon turned to Gerrard’s farewell, but it was to be a miserable afternoon in which he conceded five goals in a Premier League game for the first time.
Tottenham’s win at Everton means the Reds end up in sixth place and they will have to await the result of the FA Cup final to see at which stage they will enter the Europa League next season.
Brendan Rodgers’ men actually had the first opening of the match, when Philippe Coutinho slid the ball through for Adam Lallana, who cut inside before curling a shot around the wrong side of the far post.
He would regret that soon after, as the hosts took the lead in the 22nd minute when Marko Arnautovic laid off to Adam, whose 20-yard effort was spilled by Simon Mignolet, before Diouf was there to smash in the rebound.
It was 2-0 five minutes later and Arnautovic was again involved, cutting inside Emre Can before finding Diouf, who hammered an effort straight through Mignolet and into the centre of the goal.
The Stoke onslaught continued in the 30th minute, when Adam floated in a deep cross from the right-hand side and Can headed back towards his own goal, only to see Walters pick it up in front of Mignolet. The Liverpool goalkeeper saved his first effort, but Walters managed to get a head to the rebound as it trickled over the line for 3-0.
Liverpool were utterly shellshocked, but the Potters continued their dominance as they added a fourth in the 41st minute, when Adam caught Lucas in possession and fired a low effort from 20 yards that snuck inside the post.
The Reds had never conceded four goals in the first half of a Premier League game before, but it was 5-0 at the break as, in the 45th minute, N’Zonzi picked the ball up in midfield and raced forward unopposed before curling an outstanding effort into the top corner from 25 yards.
Liverpool changed shape at the back as Kolo Toure and Jordon Ibe were introduced, with the latter adding some good threat down the left-hand side.
The visitors had more possession in the second half but struggled to create many openings, until the 70th minute, when substitute Rickie Lambert’s header was collected by Gerrard, who saw the pitch open up in front of him as Marc Muniesa pulled up injured, allowing the Liverpool skipper to slot a low finish into the far corner.
But Stoke would have the final say, as Crouch entered the fray before getting on to the end of Diouf’s cross on 86 minutes, powering in his 47th headed Premier League goal to cap a remarkable victory for Hughes’ men.
Stoke City: Begovic (7), Cameron (7), Shawcross (7), Muniesa (6), Pieters (7), N’Zonzi (9), Whelan (7), Walters (8), Adam (8), Arnautovic (8), Diouf (8).
Used subs: Odemwingie (7), Wilson (7), Crouch (7).
Liverpool: Mignolet (4), Can (3), Skrtel (5), Sakho (4), Moreno (5), Lucas (5), Allen (5), Henderson (5), Gerrard (6), Lallana (6), Coutinho (5).
Used subs: Toure (6), Lambert (6), Ibe (7).
Man of the match: Steven N’Zonzi.