Leinster squashed Glasgow's faint Guinness PRO12 play-off bid as Joey Carbery's 74th-minute penalty saw the hosts triumph 31-30 in thrilling fashion.
A 20-minute delay due to floodlight failure threatened to end the game with just over 90 seconds remaining, but the lights came back on and sixth-placed Glasgow were unable to force a last-gasp score.
Early tries from Dominic Ryan and Rory O'Loughlin had propelled Leo Cullen's table-toppers into a 23-6 half-time lead, with prop Peter Dooley also touching down from a maul.
The wasteful Warriors, who came to Dublin needing a bonus-point victory, strung together 10 points, including an Adam Ashe try, before Zane Kirchner registered Leinster's bonus-point score.
However, Leinster needed a penalty from replacement Carbery to rescue the result as replacements Ali Price and Finn Russell inspired a two-try fightback from the visitors in the final quarter.
Fergus McFadden and Dan Leavy were the only starters retained from the Leinster team that bowed out of the Champions Cup last Sunday. Cullen's side are already assured of a home PRO12 semi-final.
Peter Horne punished a Ross Molony high tackle for the opening points amid a dominant start from Glasgow, who were 33-25 bonus-point winners in September's reverse fixture.
But Leinster picked up two tries from their first couple of visits to the Scots' 22, Ross Byrne's inside pass releasing Kirchner through the middle and he fed flanker Ryan to go in under the posts.
Fly-half Byrne, who added the conversion, was also central to the second try, his cross-field kick seeing Adam Byrne compete with two Glasgow defenders and the ball broke kindly for O'Loughlin to run in his 10th try of the season.
There was much to admire about Glasgow's attacking, with holes exploited in the Leinster midfield and Leonard Sarto threatening regularly on the right. However, knock-ons and misplaced passes blighted their play.
A Horne penalty halved the deficit to 12-6 before Leinster lifted the tempo, aided by a decibel-raising carry from retiring prop Mike Ross.
Dooley piled over at the end of a well-executed 34th-minute lineout drive near the left corner, and that try was sandwiched by two Byrne penalties to open up a 17-point gap.
Glasgow made almost immediate inroads on the resumption, a bout of pressure from the forwards leading to number eight Ashe reaching over with Horne converting.
However, Sarto, who saw yellow for a no-arms tackle, paid the price for an increasing penalty count against the visitors, and Leinster then failed to convert scrum pressure into points.
Horne's 56th-minute penalty had Glasgow within a converted score, but Leinster hit the hour mark with a 28-16 advantage, slick hands from Noel Reid and Byrne sending Kirchner spinning away from two defenders for try number four.
The momentum soon swung back in Glasgow's favour, their lively bench having an impact as scrum half Price used a loose ball to scamper into space and Jones sniffed out a try wide on the left.
Russell converted and also added the extras to his own five-pointer with 69 minutes on the clock, the Scotland stand-off doing brilliantly to twist towards the try-line and stretch out his arm, leaving a stunned Leinster 30-28 behind.
The Irish outfit have not lost a PRO12 fixture at the RDS since February 2015 and they showed just why, Carbery coolly turning a penalty from a lineout into three points before their defence eventually came out on top.