A late penalty try gave Leinster a dramatic win over Irish inter-provincial rivals Connacht in the Pro12 clash between the sides at the RDS.
A Kieran Marmion try helped Connacht to a 13-9 half-time lead, with Dan Parks kicking eight points with the boot.
Ian Madigan landed three first-half penalties and converted the late try at a time when Connacht were down to 13 men with two players sin-binned.
Leinster lie fifth in the table, with Connacht bottom of the 12 sides.
Pat Lam's side shot into an early 13-3 lead and produced an heroic backs-to-the-wall effort in trying to contain the reigning Pro12 champions.
But having lost Ronan Loughney (70 minutes) and Marmion (76) to the sin-bin, Connacht's wilting scrum was unable to keep Leinster at bay and Matt O'Connor's men escaped with a fortunate victory.
The westerners, winless in Dublin since September 2002, went 10 points up with scrum-half Marmion poaching a 13th-minute try and Dan Parks kicking the rest of the points.
Madigan's third successful penalty closed the gap to four points right on half-time, but Leinster had to bide their time against an aggressive Connacht defence.
The scoreline remained at 13-9 until the dying minutes when Connacht's penalty count took its toll, 18 in all, and Leinster's forward power, aided by replacement Martin Moore, edged it for them.
There were only two minutes on the clock when Parks drilled over a right-sided penalty from inside the 10-metre line.
Connacht's solid start continued as they tackled tigerishly to chop down both Fergus McFadden and David Kearney, and Parks drove home a penalty from halfway for 6-0.
The returning Madigan punished a scrum infringement from Jake Heenan to get Leinster on the scoreboard, splitting the posts with a confident strike from the right.
Connacht failed to take advantage of a five-metre scrum after a Madigan kick was charged down by Craig Ronaldson, but Leinster then blundered on their own scrum ball to gift Marmion the opening try.
The alert Connacht number nine reached out to score after the visitors got the push on in the set piece, with Jamie Heaslip and Eoin Reddan both unable to control the loose ball and Noel Reid beaten to it on the line by Marmion.
After Parks converted from close range, a promising Leinster attack was foiled by a Luke Fitzgerald knock-on and there was some concern for a prone Madigan, who was hit hard by Robbie Henshaw, before he got back on his feet.
Slashing runs from Mata Fifita and McFadden saw both sides attack with vigour in an open, exciting encounter, the hosts picking up the pace noticeably as Madigan landed his second penalty following a Henshaw offside.
Leinster pressed for more approaching the interval and while Connacht defended heroically, they did leak a late penalty - Craig Clarke was penalised for not rolling away and Madigan mopped up with an important three points.
Lam's charges worked a lineout maul and Wilkinson went close before Kevin McLaughlin infringed near the line, but Parks' poor penalty attempt came back off an upright and Leinster had a real let-off.
Madigan was just short with his own penalty attempt from halfway, and with man-of-the-match George Naoupu getting on the ball Connacht doggedly held onto their slim advantage.
Although handling errors from Gavin Duffy and Matt Healy invited Leinster forward, Connacht somehow survived a spell of scrum pressure near their line.
The proceedings were decidedly stop-start entering the final quarter as a succession of penalties broke up play but Leinster's hopes were boosted when replacement prop Loughney was sin-binned with 10 minutes left.
Leinster shunned a shot at the posts as they looked for their set piece to decide the game. Marmion duly seeing yellow for interfering with Isaac Boss at the base of a scrum and a couple of collapses led to the vital penalty try which Madigan converted.
Leinster: R Kearney; F McFadden, L Fitzgerald, N Reid, D Kearney; I Madigan, E Reddan; J McGrath, S Cronin, M Bent; D Toner, Q Roux; K McLaughlin, S Jennings, J Heaslip (capt).
Replacements: A Dundon for S Cronin (77), M Moore for Bent (55), M McCarthy for Roux (46), S Jennings, I Boss for Reddan (71), J Gopperth for Reid (71), Z Kirchner for R Kearney (71), R Ruddock for K McLaughlin (71).
Not used: J O'Connell
Connacht: G Duffy; T O'Halloran, R Henshaw, C Ronaldson, M Healy; D Parks, K Marmion; B Wilkinson, S Henry, R Ah You; M Swift (capt), C Clarke; M Fifita, J Heenan, G Naoupu.
Replacements: D Heffernan for Henry (41), JP Cooney for Wilkinson (61), R Loughney for Ah You (61), A Muldowney for Swift (50), A Browne for Fifita (63).
Not used: P O'Donohoe, D Leader, F Carr.