Cardiff City pulled off a smash-and-grab raid as they came from behind to beat Brentford at Griffin Park.
The Bees held a half time lead as they dominated the first 45 minutes but were pegged back after the restart.
Cardiff then struck a winner against the run of play and held on for the win despite being reduced to nine men in the later stages.
Craig Noone had a shot blocked inside the first 50 seconds for the visitors but the game soon settled in to a pattern.
Brentford were by far the more comfortable team on the ball.
They were able to link the play in midfield and put together attacking moves.
Cardiff’s defence looked nervous every time a Brentford player ran at them and the early loss of right back Lee Peltier to injury, forcing a reshuffle, did not help their cause.
A great move involving Alex Pritchard, Andre Gray and Stuart Dallas created room for Jota to shoot but his effort was deflected wide.
The Bees could have taken the lead when Jota got away on the right, racing clear of substitute Joe Ralls, but Dallas failed to make a good connection with the cut back and the effort was cleared.
Pritchard had a shot blocked after a well-worked short corner before Cardiff goalkeeper Simon Moore punched the loose ball away from Gray.
Pritchard and Gray also shot wide from distance early on as Brentford dominated.
The Bees did have the ball in the net inside the first ten minutes but Jonathan Douglas was adjudged to have fouled Moore when heading in a Gray cross at the end of a fine move.
Noone looked Cardiff’s best outlet and he missed the target with two efforts while Federico Macheda forced David Button in to a near post save with a shot from a very tight angle.
But the visitors were being forced back.
The gap between the midfield and the strikers was growing larger with Macheda and his partner Alex Revell chasing balls hoofed forward.
When the opening goal came, however, it was one that Cardiff would have expected to have kept out.
It came when Sean Morrison needlessly bundled Gray over and conceded a free kick 25 yards from goal.
Pritchard let fly with the free kick and although it moved it the air, Moore would have expected to do better than knock it down to where Gray was following up to tuck it home.
Brentford went through the gears as they looked to put daylight between themselves and their visitors before half time.
It took a fine tackle from Morrison to prevent Douglas finishing off a move involving Jota and Gray before Moore saved at the feet of Dallas after he had burst in between Fábio and Bruno Ecuele Manga.
Manga then made a fine block as Gray looked set to finish off after Jota had again got away from Ralls before the Spanish attacker saw a shot blocked.
Cardiff weathered the storm and almost equalised on the stroke of half time.
A long free kick was played in to the box, Revell headed down and Macheda shot but James Tarkowski was there to block.
Revell had another shot blocked early in the second half but the game appeared to be following the same pattern after the break.
Brentford were dominating possession and territory and Pritchard had an early shot blocked.
The Bees then went close when Pritchard went on a run down the right, he set up Gray for a shot that Moore saved and Jake Bidwell’s follow-up was blocked.
But Brentford then gave Cardiff a goal.
A long ball was lifted in to the box and Revell won the header, Button and Harlee Dean appeared to collide and the ball dropped loose for Macheda to roll it in.
The goal seemed to affect The Bees and their football became a little erratic with wasted passes and poor touches.
The Bees almost created a goal when Moses Odubajo returned a Dallas cross in to the box but Manga beat Gray to it.
And they then fell behind to another goal out of nothing.
Cardiff played a long ball down the right and Revell got on to it, he noticed Button had started to come and stopped on the edge of his penalty area so he lifted the ball over the Brentford goalkeeper and in to the net from 25 yards.
This time Brentford did respond.
Bidwell had a shot blocked and then forced Moore to tip over a bouncing header before Tarkowski nodded another corner over the bar.
Tarkowski missed the target with another header before referee Andy Davies reduced Cardiff to ten men, dismissing Kadeem Harris for a strong two-footed tackle on Alan Judge.
With a man advantage Brentford laid siege to the Cardiff goal.
Jon Toral headed a Jota corner wide at the far post when it flew across before a Tarkowski header was blocked.
Dean then had an acrobatic effort blocked and Toral headed wide again before Cardiff lost another man.
This time Macheda took an early bath, getting a second yellow card for a raising his foot against Tarkowski.
The visitors then sat deeper and deeper, trying to hang on to their lead.
Their game plan from minute one had been to hang on to what they had and that was magnified in the dying seconds.
A Tommy Smith shot deflected inches wide before Douglas blasted over.
Kenwyne Jones could have sealed the game at the other end but shot over.
However, his big influence was at the other end.
When a cross dropped loose and bounced around the box, Smith set up Tarkowski and Jones blocked the shot, heading for the net, with his arm.
This time Mr Davies saw no infringement and waved play on.
Tarkowski had a header blocked and Smith shot wide in the dying seconds.
Brentford pressed and pressed as Cardiff wasted time and eventually The Bees ran out of minutes, leaving the visitors to take an unlikely win.
Brentford: Button; Odubajo, Tarkowski, Dean, Bidwell (sub Smith 82 mins); Douglas, Diagouraga (sub Judge 66 mins); Jota, Pritchard, Dallas (sub Toral 78 mins); Gray
Subs (not used): Bonham, Craig, McCormack, Long
Cardiff City: Moore; Peltier (sub Ralls 12 mins), Manga, Morrison, Fábio; Noone, Gunnarsson, Whittingham, Kennedy (sub Harris h/t); Macheda, Revell (sub Jones 75 mins)
Subs (not used): Wilson, Malone, Doyle, O’Keefe
Bookings: Morrison (27 mins), Macheda (39 mins), Whittingham (58 mins)
Sent Off: Harris (78 mins), Macheda (89 mins)
Attendance: 11,217 (1,502 away fans)
By Chris Wickham