England's biggest ever victory in a major tournament ensured smooth progress to the knockout stages of the competition, and they now have the exact same record after two games as group rivals Belgium ahead of Thursday's meeting between the two sides.
Panama, who were dreadful in terms of both ability and discipline, were eliminated with the defeat and they now have the worst goal difference of any team at the tournament going into their final game, a dead rubber against Tunisia.
England made just one change from the side that beat Tunisia, with Ruben Loftus-Cheek replacing the injured Dele Alli. Panama manager Hernan Dario Gomez went one better, naming an unchanged team from the one that opened with a 3-0 defeat to Belgium.
England had a penalty shout go against them within the first minute as Gabriel Gomez elbowed Jesse Lingard in the face. Gomez conned the referee into thinking it was a clash of heads but replays showed he was lucky to get away with it, though VAR took no action.
The first opening of the game went Panama's way as a nice move culminated with Anibal Godoy skewing his shot wide of the mark when he should have tested Jordan Pickford.
But it was England who struck first. They would surely have had a penalty as Harry Maguire was trapped in a bear hug in the box, but it didn't matter as John Stones made the most of non-existent marking to power his header into the bottom corner past Jaime Penedo.
Edgar Barcenas curled a nice effort just wide of Pickford's post but the underdogs soon found themselves two goals behind. Fidel Escobar brought down Lingard in the box and Harry Kane kept his cool despite some Panamanian gamesmanship to score his third of the tournament.
Every time England attacked, they looked like they could score. And they did. Lingard joined the party with his first competitive goal at international level, playing a one-two with Raheem Sterling before sending a wonderful dipping effort beyond the desperate reach of Penedo.
The best-worked goal of the game made it four within a matter of minutes. Kieran Trippier's short free kick was chipped into the box by Jordan Henderson and headed across goal by Kane. Sterling couldn't beat Penedo from point-blank range but the rebound fell to Stones, who doubled his tally with a header into the roof of the net.
The goals just kept coming. Kane practically had the shirt pulled off his back by Godoy, and the Egyptian referee was having absolutely none of it. Kane resisted the urge to let Stones complete his hat-trick and dispatched the spot kick with the same confidence he had shown with the first one.
It was the first time a team had scored five goals in the first half of a World Cup match since Germany did it against Brazil in the semi-finals four years ago.
It took England 15 minutes to get their sixth in the more sedate pace of the second half, but when it came it was a historic goal. Harry Kane became just the third player to score a World Cup hat-trick for England, though it was a fortuitous goal which completed the treble as Ruben Loftus-Cheek's shot deflected in off his heel.
Kane was then replaced to a standing ovation, with Jamie Vardy coming on, and Fabian Delph was also given a run-out in place of Lingard. Panama could have had a consolation as Michael Murillo raced through on goal but Pickford stood up well to make his first save of the day.
England's final change saw Danny Rose replace Trippier. Henderson nearly got the seventh as a header dropped to him on the edge of the area and he showed good technique to volley just wide of the mark.
3 - Harry Kane is only the third England player to score a hat-trick in a World Cup match, after Geoff Hurst in the 1966 final, and @GaryLineker vs Poland in 1986. Illustrious. #ENGPAN #ENG #WorldCup pic.twitter.com/KH50ZlnmZJ— OptaJoe (@OptaJoe) June 24, 2018
England went to sleep at the back for a few minutes and failed to heed Panama's warnings. Roman Torres missed a gilt-edged chance from a corner but the Central American side did get their first ever World Cup goal when Felipe Baloy beat the offside trap to slide in a joyous consolation goal.
The match petered out after that, but it was still a historic occasion for both sides. Every Englishman will remember where they were when England scored five in the first half of a World Cup match, and every Panamanian will remember where they were when they scored against the mighty Three Lions.
England now meet Belgium in Kaliningrad for the right to finish top of the group, while Panama will try to get their first World Cup win against Tunisia in Saransk.