Cardiff Blues booked their place in the Heineken Cup quarter-finals on Sunday after coming from behind to beat Gloucester 16-12 at Kingsholm -despite playing two-thirds of the match with 14 men.
A betting man would have backed Gloucester to walk away with four vital competition points when Cardiff wing Tom James was shown a red card after 28 minutes.
But a try in the dying minutes from replacement forward Bradley Davies put the visiting Welshmen in front for the first time in the game and earned Cardiff an historic win.
A losing bonus-point for Gloucester means they still have a slim hope of making the play-offs, provided they score maximum points away to Biarritz next week.
Only one try was scored in eighty minutes of rugby but both teams must be commended for having a go on a sticky surface.
Faced with some courageous defending from Cardiff , the Cherry and Whites lacked the touch of inspiration needed to break through. Cardiff lacked, well, a left wing!
The Cardiff set-piece has come under some scrutiny in recent weeks - from their own coach especially - and it was the Blues' scrum that would concede the first points when referee Alan Lewis decided the visiting front row had gone down unnecessarily. Olly Barkley opened the scoring on the stroke of seven minutes with a mammoth penalty from inside his own half.
The Blues were full of enterprise and were rewarded for their positive play at the end of the first quarter when Leigh Halfpenny slotted a penalty to level the scores.
Gloucester replied immediately as Barkley kicked his second three-pointer.
Just inside the half-hour mark the game took a crucial turn in Gloucester's direction. With Cardiff in full attack and camped on the home side's try-line, tempers frayed and Blues wing Tom James had a rush of blood to head - and used his noggin to head-butt Olivier Azam, right under the referee's nose.
Azam's theatrical football-style reaction aside, Alan Lewis had no choice but to show the Welsh wing a red card. Such behaviour cannot be tolerated, and he had to go.
Barkley compounded the visitors' woes four minutes later with another penalty.
A man down and trailing by six, Cardiff looked in trouble, but they continued to play positively. A Jason Spice high tackle went unpunished when Barkley's penalty kick bounced back off the cross bar and the Blues were able to hold on until half time.
The home fans were left stunned when Halfpenny pulled another three points back in the opening minutes of the second period, and positively relieved when the young full-back missed another that would have brought the 14-man Blues level.
The Cardiff pack were immense, and were driving, bashing, crashing and running hard into hosts territory. But Gloucester fly-half Ryan Lamb was well aware of where he should attack and on a number of occasions turned the Blues on their heels with penetrating kicks into James's vacant left corner.
A period of sustained pressure from the hosts saw them restore their six point lead when Barkley kicked his fourth, and last penalty.
Two missed penalties from Halfpenny left the pessimists wondering what might have been, but the Blues never said die.
When the Cardiff pack produced a huge scrum to win a penalty and the full-back was on target to make the score 12-9 with eight minutes to play, the miracle seemed possible.
A full 44 minutes with a man down, and they the gap was the same as it was when James left the field.
With Gloucester running out of ideas and confidence, Jamie Roberts hoofed the ball into the corner. Under pressure from a chasing Roberts, Willie Walker fluffed his clearance and Cardiff had a golden opportunity to strike. When Davies found a half-gap around the side of a ruck on the Gloucester line, he didn't need to second invitation and leapt over the whitewash.
Halfpenny provided the extra two and that was all she wrote as Gloucester were unable to conjure something up in the three remaining minutes.
Man of the match: Leigh Halfpenny showed once again that he has bags of talent and Andy Powell was simply sublime when carrying the ball but Jamie Roberts gets our nod. The defended like a man possessed and his kick and chase set up the winning try.
Moment of the match: A couple of moments all seemed to point towards a Gloucester win. James's sending off and a questionable decision to deny Cardiff scrum-half Jason Spice a try stand out. But Willie Walker's sliced kick which lead to Davies' try could have changed the entire competition.
Pens: Barkley 4
For Cardiff Blues:
Pens: Halfpenny 2
Red card: Tom James (Cardiff) - head-butt, 28.
Gloucester: 15 Willie Walker, 14 Iain Balshaw, 13 Matthew Watkins, 12 Olly Barkley, 11 James Simpson-Daniel, 10 Ryan Lamb, 9 Gareth Cooper, 8 Luke Narraway, 7 Apolosi Satala, 6 Alasdair Strokosch, 5 Alex Brown, 4 Marco Bortolami, 3 Carlos Nieto, 2 Olivier Azam, 1 Alasdair Dickinson.
Replacements: 16 Andy Titterrell, 17 Nick Wood, 18 Will James, 19 Adam Eustace, 20 Dave Lewis, 21 Antony Allen, 22 Mark Foster.
Cardiff Blues: 15 Leigh Halfpenny, 14 Gavin Thomas, 13 Tom Shanklin, 12 Jamie Roberts, 11 Tom James, 10 Nicky Robinson, 9 Jason Spice, 8 Andy Powell, 7 Martyn Williams (c), 6 Maama Molitika, 5 Scott Morgan, 4 D Jones, 3 Gary Powell, 2 Gareth Williams, 1 Gethin Jenkins.
Replacements: 16 Taufa'au Filise, 17 Rhys Thomas, 18 Bradley Davies, 19 Xavier Rush, 20 D Allinson, 21 Ceri Sweeney, 22 Jamie Robinson.
Referee: Alan Lewis (Ireland)
Touch judges: John Lacey (Ireland), Seamus Flannery (Ireland)
Television match official: Marshall Kilgore (Ireland)