A 20-minute delay due to floodlight failure threatened to end the game with just over 90 seconds remaining, but the lights thankfully came back on and sixth-placed Glasgow were unable to force a last-gasp score.

Early tries from Dominic Ryan (4 minutes) and Rory O’Loughlin (8) 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 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, the PRO12 leaders needed a penalty from replacement Carbery to rescue the result as replacements Ali Price and Finn Russell inspired a two-try fight-back from the visitors in a breathless 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 of September’s reverse fixture at Scotstoun.

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.

Out-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 Leonardo 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 who was given a standing ovation when he was replaced in the second half.

Ross’ front row colleague 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. A key figure during this spell was scrum half Nick McCarthy who deservedly won the man-of-the-match award.

Glasgow made almost immediate inroads on the resumption, though, a bout of pressure from the forwards leading to number 8 Ashe reaching over with Horne converting.

However, Sarto, who was sin-binned for a no-arms tackle, paid the price for an increasing penalty count against the visitors, and Leinster, who had an impressive cameo performance from Peadar Timmins, 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 Adam 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 pacy scrum half Price used a loose ball near halfway to scamper into space and Lee 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 momentarily stunned Leinster 30-28 behind.

Yet, the men in blue have not lost a PRO12 fixture at the RDS since February 2015 and they showed just why in the closing stages, Carbery coolly turning a penalty from a lineout into three points before their defence eventually came out on top.