Sam Davies held his nerve to hammer home a 79th minute conversion of replacement hooker Ifan Phillips' try to snatch victory from the jaws of defeat for the Ospreys against the Cheetahs.
The home side were staring at a potential fourth defeat of the season at the Liberty Stadium in the Guinness PRO14 before Phillips powered over for a third Ospreys try of the night - leaving Davies to seal the win with his conversion from half way out on the right.
The Wales outside-half had already landed two penalties and converted tries from Ashley Beck and Sam Cross and, although the pressure was on, he never looked like missing and the Welsh region snatched a 27-26 win.
It was a cruel end to their three-match tour for the South African side, who remain in third place in Conference B. After narrow defeats to Cardiff Blues and Glasgow Warriors, they looked odds-on to win this one and give their play-off hopes a considerable boost.
Cheetahs centre Nico Lee was the first of three players held up on the line before hooker Torsten van Jaarsveld finally drove over from a close range line-out.
That try went unconverted, but outside-half Niel Marais could not miss when giant lock Reniel Hugo hit a huge hole in the home defensive line to romp over at the posts.
That gave the visitors a 12-point lead and the only points the Ospreys could muster in the first half was a Davies penalty on the stroke of half-time.
The gap was reduced further three minutes after the restart when Beck ran in a try that Davies improved. That made it a two-point game, but the Cheetahs were in no mood to lose their lead.
The visitors broke brilliantly from their own 22 and worked Lee clear to race over from 60 metres for a score that Marais converted.
Now it was the turn of the Ospreys to dig deep and Cross picked a strong line to crash over from close range for another home try that Davies converted, to cut the gap to two points once again with 26 minutes to go.
The game was back in the melting pot, although it was the Cheetahs who scored next. This time it was a gift of a try as Jeff Hassler ballooned a midfield pass that was picked off by speedy wing Craig Barry, who raced to the posts for Marais to convert.
That left the home side with a mountain to climb once again - but they refused to give in.
Davies kicked a 25m penalty and that left his side with 10 minutes to conjure up a match-winning try.
It took them almost all of that time to actually get it and then the number 10 added the conversion to complete the comeback.
For the Cheetahs it was a sorry end to a solid night's work, although there was some consolation for them in the shape of two bonus points.