Ryan Kent scored twice as Rangers won at Hamilton to stay level with Scottish Premiership leaders Celtic.
Ryan Jack rolled in an early goal for the visitors only for Lewis Smith to nod in an equaliser after his initial effort had been blocked.
Just before half-time, Kent restored Rangers’ lead with a stunning strike from 20 yards.
Mickel Miller was guilty of a glaring close-range miss for Accies before Kent struck again in stoppage time.
Celtic are now three goals in front of their Glasgow rivals at the top, while Hamilton could drop to the bottom if St Johnstone beat Aberdeen in the weekend’s final fixture.
Rangers leave it late to finish off dogged Accies
The hosts looked in danger of being swept aside when Jack found the bottom corner of the net with a composed finish in a busy penalty area but Brian Rice’s team hung on in and were doing most of the pressing in the closing stages of a disjointed second half.
Miller’s miss was nothing short of astonishing as he somehow knocked the ball wide on the slide from no more than a yard out.
With the Rangers defence posted missing, substitute George Oakley flashed the ball across goal. Glen Kamara got the slightest touch on the delivery, which altered the trajectory of the ball, but it remains a mystery how Miller could not apply the finish.
Later, Oakley managed to squeeze a header on target but it was comfortably saved by Allan McGregor under his crossbar.
Those chances served as a wake up call to Rangers, who had completely bossed the first 60 minutes, and a cute pass from substitute Alfredo Morelos gave Kent the time and space to pick his spot for his second goal.
It was an impressive finish but not in the same class as the rocket that had given his side a 2-1 lead moments before the break.
Kent, who had earlier clipped the outside of the post with a shot after a driving run and had a strong penalty claim when another effort hit the arm of Alex Gogic, cut in from the right and thundered a shot into the opposite top corner for his first goal since completing his £7m summer switch from Liverpool.
Jack, full of confidence after good showings for Scotland, was pulling the strings for Rangers throughout the first half.
The midfielder calmly slotted past debutant goalkeeper Luke Southwood after seven minutes and went close with two other shots from outside the box.
He also provided a sublime pass for James Tavernier to run on to but the captain took an unnecessary extra touch, allowing Southwood to smother at his feet.
Smith was full of running for Accies and scored his fourth goal of the season when Steve Davies did well to head a Miller cross into his path. Filip Helander make a terrific block inside the six yard box but the ball looped up into the air, allowing the 19-year-old to follow up and knock the ball in.
Rice will be pleased with the home team’s endeavour, which suggests they once again have an appetite to scrap their way to top flight survival, while Gerrard will be delighted to keep pace with Celtic but will want to know why his side lost their rhythm in the last 30 minutes.
Man of the match – Ryan Kent
BBC Scotland’s Jane Lewis at the Fountain of Youth Stadium
Accies lost the game, but they made Rangers work hard for their three goals and three points. With that in mind, it would be remiss of me not to mention Brian Easton and Jamie Hamilton at the back for Accies, while Steve Davies up front was effective, as he used his power really well, as demonstrated in his assist for the Accies equaliser.
However, Ryan Kent just gets the nod. His two goals were wonderfully executed, especially his first of the afternoon. After injury, Kent looks to be back at full fitness, and if he’s adding more goals to his game, he’ll continue to be a prized asset for Rangers.