Rangers needed Kemar Roofe to come off the bench and grab a vital winner nine minutes from time as they moved level on points with Celtic at the top of the Scottish Premiership.
On the day the Scottish champions were celebrating their 150th anniversary, Rangers nearly dropped more precious points in the battle for the title against an Aberdeen side languishing just above the relegation zone.
Giovanni van Bronckhorst was criticised for not using his bench at all in a 1-0 win at St Johnstone in midweek, but this time his changes proved crucial as Roofe bundled home James Tavernier's header across goal.
Aberdeen are now winless in 10 games, including three since new manager Jim Goodwin took over.
Celtic remain top on goal difference and have a game in hand when they visit Livingston on Sunday.
Hearts retain a huge 13-point lead over the chasing pack in third after also scoring late to secure a 2-2 draw at Dundee United.
Hibernian stay in fourth after a third consecutive 0-0 draw against second bottom St. Johnstone.
Dundee remain bottom, one point behind St Johnstone, after a 1-1 draw at Motherwell.
Ross County moved into the top six as Joseph Hungbo's penalty beat St Mirren 1-0.
Rangers strike late on 150th birthday to close on Celtic
4 years ago