Number eight Morgan Allen's last-gasp try saw a young Ospreys side overcome Gloucester 33-27 in a dramatic LV= Cup encounter at the Liberty Stadium.
The hosts had led 26-13 with eight minutes to go but a Dan Murphy score and a penalty try put the Aviva Premiership side ahead with time running out.
But the Ospreys responded emphatically, driving Allen over the line against some tentative defence to seal an excellent win. Wing Tom Grabham also crossed for the Ospreys, with fly-half Matthew Morgan kicking four penalties and two drop goals, while replacement Sam Davies, son of Gloucester boss Nigel, slotted five points.
There was little indication of the drama to come during a scrappy opening quarter in difficult conditions, with Morgan kicking a drop goal and a penalty, with Burns slotting two penalties for Gloucester.
Referee David Rose sent lock James King to the bin and it proved costly as, from a third maul, hooker Tommaso D'Apice broke through and offloaded for front-row colleague Yann Thomas to crash over, with Billy Burns adding the extras.
Morgan responded with his second drop goal and added his second penalty when Gloucester skipper Peter Buxton strayed offside to trim the gap to just a point with five minutes to go to the break. A well-controlled drive from the Ospreys yielded a penalty which Morgan knocked over right on half-time to give them the interval advantage.
The Cherry and Whites were under sustained pressure and their discipline cracked when Ross Jones launched a sharp Ospreys counter, Buxton cynically infringed and was dispatched to the bin, with Morgan kicking the resulting penalty. That was the fly-half's last contribution as he was replaced by Davies.
The youngster wasted little time putting the boot into the hopes of his father's side by slotting a long-range penalty, and he looked to have helped the hosts land the killer blow when he rounded off a sharp attack with a long pass that sent Grabham in at the corner. But Gloucester hit back.
Murphy dove under the posts with eight minutes to play and a powerful driving maul forced the Ospreys to infringe and referee Rose had no hesitation in marching under the posts.
Scrum-half Dan Robson added the conversion to put Gloucester ahead and that should have been that, but there was more drama to come as the Ospreys piled in behind Allen to drive the back-rower over the line and spark jubilant celebrations.