Leinster scored a crucial 77th-minute penalty try to come from behind to defeat Connacht 16-13 at the RDS in Dublin.
Despite going into the encounter with just one win in the league all season, Pat Lam's side went into the interval 13-9 ahead through Kieran Marmion's try and eight points from the boot of Dan Parks.
In a lacklustre first half, Ian Madigan's three penalties was the home team's response before the break as they struggled to break down a resilient Connacht.
However, when Ronan Loughney and Marmion were sin-binned towards the end of the match, the pressure resulted in a penalty try being awarded.
The visitors went into the game in bottom position in the Pro12, but they made a bright start to proceedings and took an early 6-0 lead through the boot of Parks.
Although Madigan immediately reduced the deficit with a penalty of his own, the hosts were surprisingly poor defensively. And a mistake on their own try-line allowed the impressive Marmion to snipe and touch down.
The conversion from their stand-off was successful and they opened up a shock 13-3 advantage.
Matt O'Connor's men then moved up a gear stretching the Connacht rearguard but, despite enjoying the majority of possession, successive Madigan three-pointers were their only reward before half-time.
Both teams had opportunities to add to the score at the start of the second period, but the respective kickers missed a chance each at goal.
With ten minutes remaining Loughney was sin-binned for the Galway-based outfit before the pressure told further on the away side when Marmion was also yellow carded. And it was no surprise to see a penalty try awarded just two minutes from the end as Leinster somehow snatched the win.
Pens: Madigan 3
Pens: Parks 2
Yellow Cards: Loughney, Marmion
Leinster: 15 Rob Kearney, 14 Fergus McFadden, 13 Luke Fitzgerald, 12 Noel Reid, 11 Dave Kearney, 10 Ian Madigan, 9 Eoin Reddan, 8 Jamie Heaslip (capt), 7 Sean O'Brien, 6 Kevin McLaughlin, 5 Quinn Roux, 4 Devin Toner, 3 Michael Bent, 2 Sean Cronin, 1 Jack McGrath
Replacements: 16 Aaron Dundon, 17 Jack O'Connell, 18 Martin Moore, 19 Mike McCarthy, 20 Shane Jennings, 21 Isaac Boss, 22 Jimmy Gopperth, 23 Zane Kirchner
Connacht:15 Gavin Duffy, 14 Tiernan O'Halloran, 13 Robbie Henshaw, 12 Craig Ronaldson, 11 Matt Healy, 10 Dan Parks, 9 Kieran Marmion, 8 George Naoupu, 7 Jake Heenan, 6 Mata Fifita, 5 Craig Clarke, 4 Michael Swift (capt), 3 Rodney Ah You, 2 Sean Henry, 1 Brett Wilkinson
Replacements: 16 Dave Heffernan, 17 JP Cooney, 18 Ronan Loughney, 19 Aly Muldowney, 20 Andrew Browne, 21 Paul O'Donohoe, 22 Darragh Leader, 23 Fionn Carr
Referee: David Wilkinson (IRFU)
Assistant referees: Mark Patton, Barrie O'Connell (both IRFU)
TMO: Alan Rogan (IRFU)