Sam Davies kicked a last minute touchline conversion to end Sale Sharks' hopes of reaching the LV= Cup semi-finals and give Ospreys a 37-36 win at Bridgend.
The English club needed a bonus point win to reach the last four and they looked on their way as they led 28-13 at the break.
However, the Ospreys bounced back from 36-20 down after 55 minutes - with wing Aiesa Natoga to complete a try-hat-trick.
Ospreys had only one point from their three previous LV= Cup games and they went into their clash at B rewery Field with Sale all but making up the numbers.
The Sharks went into the game with an unchanged team from the one which beat Worcester 20-6 last week - their sixth win from seven games in all tournaments.
The visitors seemed to have put the match pretty much to bed at half-time as they led 28-13.
They showed their intent in only the third minute when Viliami Fihaki crashed over from a line-out drive for the first of his three tries.
But a young Ospreys outfit went ahead briefly 10-7 with a penalty goal from Davies, who inspired a great try with a run from inside his own 22.
Full-back Richard Fussell followed on that break by helping to put Natoga over on the left.
But apart from a second Davies penalty it was all Sharks for the rest of the half.
Fihaki popped up again to go over from another line-out drive. Then in the space of five more minutes Sale had the invaluable bonus point.
First more pressure in the Ospreys' 22 saw wing Chris Ingall go over on the right.
And a turned over line-out produced Fihaki's hat-trick score, with the number eight making a dart over the line from five metres.
In the second half Natoga scored his second try but that was cancelled out by a try for full-back Mike Haley and a Joe Ford penalty.
But then came the remarkable comeback started by a try for impressive number eight Dan Baker.
Sale did not help their cause as forwards Ross Harrison and Marc Jones were sent to the sin-bin.
Ospreys took advantage with Natoga claiming his third before Davies converted from the touchline.