Last updated on .From the section Scottish Premiership

Rangers climbed back into second in the Scottish Premiership as Josh Windass scored a hat-trick in an entertaining victory at Hamilton Academical.

Six goals were scored in the opening 34 minutes, with Darren Lyon netting the first for the home side before Jamie Murphy levelled.

Windass put the visitors ahead, David Templeton equalised, then Alfredo Morelos and Windass made it 4-2.

Windass hit his third after the break, before Dougie Imrie scored a penalty.

The eight goals made this the highest-scoring Premiership game this season - and uncomfortable viewing for defensive purists.

Victory moved Rangers back above Aberdeen on goal difference, with Celtic nine points clear at the top after drawing 0-0 with St Johnstone.

Hamilton midfielder Darren Lyon opened the scoring after just five minutes

From the outset, the play was a combination of carelessness and composure. Neither side was able to eradicate mistakes at the back; in attack, there was an element of ruthless finishing.

Hamilton were the first to take advantage. They won two corners in the opening four minutes, and while the Rangers defence was still looking disorientated, the home side worked the ball into the box, Lewis Ferguson's touch carried it to Lyon, and the midfielder calmly steered a shot past Wes Foderingham and into the far corner.

Hamilton lined up with a back three, as well as two debutants in defender Kenny van der Weg and midfielder Ross Jenkins. There might have been a sense of unfamiliarity about the team, and they tended to reel as Rangers attacked.

Rangers winger Jamie Murphy equalised with a well-placed finish

The visitors were soon level. Morelos had already steered a header off the face of the crossbar from Greg Docherty's cross, and the latter was involved in the equaliser on his first return to the SuperSeal stadium after leaving in January. Docherty's pass found Morelos, and his cutback from the byeline was turned into the net by Murphy.

Anxiety was contagious, and Hamilton goalkeeper Gary Woods was the next to be afflicted. He was well positioned to hold Windass' shot from the edge of the box, but the ball skewed off his chest and up through his arms on its way into the net.

The game had yet to settle on a pattern of play, and Rangers' failure to clear their lines was to prove costly. The ball was returned upfield to Templeton on the edge of the area, and he spun to curl a shot past Foderingham.

Hamilton goalkeeper Gary Woods made an uncharacteristic error with Josh Windass' shot

Eventually, Rangers found a form of command. It came from the scoreline rather than the flow of the game, though. They regained the lead when Murphy's shot was blocked, but he latched onto the rebound and squared for Morelos to score.

Windass then became prominent. First he scored his second of the game, finishing adroitly from Murphy's flick into his path. Then he ought to have completed his hat-trick, but blazed a volley high and wide.

There was still time during a frantic first half for Woods to make a double save, first pushing away Sean Goss' free-kick, then blocking Morelos from the rebound.

Hamilton attacker David Templeton struck back with his second goal of the season against his former side

The interval had little impact on the game's frantic nature, but the goals stopped raining in for a time. Rangers remained the more threatening side and should have scored a fifth from a corner kick.

The ball reached Docherty on the edge of the area and his shot bounced off the bar. It fell to David Bates, but from close range he headed wide.

Shrewdness was still excluded from much of the play, and Murphy was reckless as he attempted a pass back from the halfway line. Marios Ogboe intercepted but his shot was blocked by Foderingham.

Rangers striker Alfredo Morelos re-established the visitors' lead before half-time

For all the lax defending, presence of mind was still a feature of the contest. Daniel Candeias certainly showed it as he took a quick throw-in to Morelos. As the Hamilton defence slept, the striker crossed for Windass, who converted from inside the penalty area to complete his second hat-trick of the season.

Even then, the game was not allowed to drift to its conclusion. Ferguson made a burst into the Rangers penalty area and his shot cannoned off the hand of Russell Martin as he slid in to block.

Referee Bobby Madden pointed to the spot, and Imrie converted with a fiercely struck effort. Finally, the scoring was complete.

Hamilton's Dougie Imrie scored a late consolation goal from the penalty spot