Ulster kept their play-off hopes alive after edging past Edinburgh 32-20 in a breathless encounter at BT Murrayfield.
The Irish side had to win to keep alive their slim hopes of breaking into the top three in Conference B of the Guinness PRO14, and a thrilling first-half display proved enough to see off Edinburgh.
Winger Jacob Stockdale played a key part as they ran in three stunning tries before the break, while Duncan Weir finished the game with 13 points to his name as he dragged the hosts back into the game.
Despite a penalty try, Edinburgh were unable to come back after conceding a 13-point lead and must wait to confirm their place in next season’s European Champions Cup.
Any hopes Richard Cockerill had of a tight, disciplined start were quickly dashed as an unforced error handed the visitors the upper hand.
Individual mistakes littered their Challenge Cup defeat to Cardiff last week and despite taking an early lead through a Duncan Weir penalty, Phil Burleigh’s poor kick handed Ulster territory and possession and they were made to pay.
Stockdale broke free down the left and he showed his pace before unselfishly feeding inside for Darren Cave for the first try of the match.
Weir reduced the deficit to just a point soon after, but Ulster again showed their cutting edge in attack with another move from the line-out, eventually working an overlap on the right before Charles Piutau – whose sublime offload set Stockdale free for the first – crashed over.
Another scintillating team move minutes later saw Six Nations man of the tournament Stockdale break free and send John Cooney under the posts, but the scrum-half was at fault minutes later as Weir read his pass and ran in for an intercept try from half-way for the game’s fourth try before the half-hour mark, leaving it 19-13 to Ulster.
From there, the hosts gained in confidence and although they could not close the gap further, ended the half the stronger of the two sides.
They came out from the break and picked up from where they had left off, but their inability to make that dominance count cost them when Cooney kicked three points from a rare Ulster attack.
That did not put Edinburgh off however, and after a sustained period of pressure they pulled another try back.
They overpowered Ulster in the scrum and after several infringements by the line, referee Nigel Owens eventually awarded a penalty try to pull it back to 22-20.
Cooney restored the five-point lead as Edinburgh attacked before the game was put to bed through Iain Henderson, who made sure of the bonus point from close range.