Ross Molony's 66th-minute try saw Leinster squeeze past Cardiff Blues for a nervy 22-21 Guinness PRO12 win at a sunny RDS.
Leo Cullen's men remain top of the table despite coming under fierce pressure from a Cardiff side who thrived on turnovers, charging out of their own half for all three of their tries.
Dan Leavy and Luke McGrath returned from Ireland duty with a try apiece as Leinster led 14-7 at half-time, the Blues hitting back with a well-worked Tomos Williams effort.
Cardiff continued to capitalise on Leinster errors, a slick counter-attack putting scrum-half Williams over for a levelling 47th-minute try before Ross Byrne's penalty made it 17-14.
A breakaway score from Cardiff replacement Sion Bennett had Leinster's two-year unbeaten PRO12 run at the RDS under serious threat, however second row Molony's five-pointer from a maul proved to be the match winner.
Cian Healy and Noel Reid were both prominent in a strong start from the province, the latter's grubber kick being gobbled up by Leavy for a try in the right corner. Byrne topped it off with a terrific conversion.
Williams answered back for the visitors in the 12th minute, Rey Lee-Lo initiating a clever break on the left and then taking Blaine Scully's return pass before sending the supporting number nine over.
Steven Shingler added the extras from close range. The Blues continued to threaten on the counter, a better pass from Shingler would set up captain Scully for their second try but Adam Byrne did well to deny him out wide.
Leinster came out of a patchy spell with their scrum getting on top, particularly Healy on the loosehead side, and after Michael Bent was stopped just short in the 33rd minute, McGrath dived over from the ruck and Byrne turned it into a seven-pointer.
Neither side could profit from line-out opportunities as the interval approached, and it was out-half Byrne who impressed on the resumption with some deft tactical and crossfield kicking.
A foot in touch from Joey Carbery denied Reid a try, but Leinster soon conceded a soft score when Gareth Anscombe covered an Isa Nacewa kick and sent Kristian Dacey countering up the right wing.
The hosts were caught for numbers and the hooker passed inside for Williams to complete his brace, with Shingler converting.
Although Byrne's penalty restored their lead, Cardiff quietened the home crowd when another Leinster move broke down and Lee-Lo and Scully combined to set replacement Bennett cantering clear from halfway.
Shingler's conversion made it 21-17 and with both sides facing European quarter-finals next week - Leinster host Wasps and Cardiff are at Gloucester - this was a full-blooded preamble.
Cullen's side got back on track when Leavy forced a ruck penalty and from the ensuing five-metre line-out, Molony used a maul to scramble over near the right corner flag.
The grounding was confirmed, with Byrne's missed conversion leaving just a point in it. Leinster hung on by the minimum margin in the end, Cardiff blowing a couple of gilt-edged chances as Nacewa produced a try-saving tackle on Tom James and then Matthew Morgan threw a forward pass with a glaring overlap to exploit on the right wing.