A marvellous save by keeper Allan McGregor with three minutes left allowed Rangers to take all three points from this enthralling match.
How Rangers found themselves hanging on near the end was a mystery, such was their domination of the first hour.
Two up in ten minutes through goals by Kris Boyd and Steven Davis, it looked a matter of how many goals the home team were going to score.
St Mirren hung on grimly and gained their reward when Franco Miranda swept the ball home from the edge of the box with nine minutes to go.
Rangers started the match superbly and within five minutes had taken the lead. Boyd's header was laid back to him by Kenny Miller and the striker drilled his shot past Mark Howard from 18 yards.
It looked all over for the visitors when they fell two behind. A superb build-up ended with Miller laying the ball off to Davis who side-footed home from ten yards.
Miller shot narrowly over as Rangers took control and then Charlie Adam was inches high with another effort.
The Gers nearly added to their lead shortly after the break but Barry Ferguson's net-bound shot was deflected for a corner.
Miller then missed a sitter when he latched on to Miranda's short back-pass, rounded the keeper, but then blasted over an open goal from only six yards.
Howard saved bravely at the feet of Miller and then did well to keep out a powerful shot from Boyd.
Miller was unlucky when his flick from Kirk Broadfoot's superb cross came back off the face of the bar.
The home team were nearly made to pay for the misses when Miranda shot home from the edge of the box.
The Saints substitutes, Dennis Wyness and Craig Dargo, were causing the Rangers defence all sorts of problems and Dargo's free-kick near the end was superbly saved by McGregor to deny Saints a share of the points.