Paul Marshall's late try snatched victory for Ulster away at defending Pro12 champions Ospreys in Swansea.
John Afoa was stopped just short of the line but replacement scrum-half Marshall was alert to dive over.
Paddy Jackson added the conversion to the two penalties he struck after taking over fly-half duties from Niall O'Connor who struggled with the boot.
Ospreys had led since wing Hanno Dirksen's 24th-minute try, with Matthew Morgan kicking eight points.
There was plenty of intent shown from both sides, but all too often promising attacks were undone by sloppy handling.
It took until 22 minutes for the game to come alive with right wing Dirksen producing a superb individual run to claim the game's first try.
Picking up a loose pass 35 metres out, Dirksen hurtled through a fragile defence, fended off Ulster full-back Jared Payne and then turned on the afterburners to make the line unopposed.
Morgan added the extras, but the Ospreys failed to build on their lead as mistakes continued to plague their game.
Ulster fly-half O'Connor made up for an earlier miss to land a fine long-range penalty after 31 minutes, but failed with an ambitious attempt from inside his own half just before the break as the Ospreys went in at half-time 7-3 to the good.
Two penalties from Morgan after the break extended the home side's advantage as the champions attempted to assert control.
But a clutch of substitutions by Ulster coach Mark Anscombe turned the match on its head.
The arrival of former New Zealand prop Afoa and Ireland prop Tom Court saw the Ospreys scrum forced into retreat, while back-row Stephen Ferris produced some thunderous tackles.
Another replacement, Jackson, nailed a couple of penalties to make it 13-9 before yet another member of the cavalry, scrum-half Marshall, claimed the match-winning score with six minutes remaining.
A sharp counter-attack from wing Craig Gilroy set up the opportunity which eventually saw Marshall touch down from close range after Afoa had been stopped just shy of the line.
It needed the television match official to confirm the score, but Marshall and his Ulster team-mates were in little doubt.
It left the Ospreys with little time to redeem themselves, but any chance they had of salvaging the win disappeared when they coughed up the ball again.
Ospreys: Richard Fussell; Hanno Dirksen, Andrew Bishop, Ashley Beck, Tom Isaacs; Matthew Morgan, Rhys Webb; Ryan Bevington, Richard Hibbard, Aaron Jarvis, Ian Gough, Alun Wyn Jones (capt), James King, Justin Tipuric, Jonathan Thomas.
Replacements: Scott Baldwin for King (65), Duncan Jones for Bevington (74), Joe Rees for Jarvis (74), George Stowers for Thomas (61), Joe Bearman for Gough (55), Kahn Fotuali'i, Dan Biggar for Morgan (61), Tom Grabham for Isaacs (57).
Ulster: J Payne; C Gilroy, D Cave, L Marshall, M Allen; N O'Connor, M Heaney; C Black, R Herring, D Fitzpatrick, J Muller (capt), L Stevenson, M McComish, S Doyle, N Williams.
Replacements: N Brady for Herring (49), T Court for Black (41), J Afoa for Fitzpatrick (49), N McComb for Stevenson (66), S Ferris for Doyle (55), P Marshall for Heaney (41), P Jackson for O'Connor (55), A Trimble for L Marshall (55).
Ref: Neil Paterson (SRFU).