Three goals in four minutes in extra time ensured Brentford progressed to the FA Cup with Budweiser Third Round.
The Bees trailed twice to npower League Two Bradford City in a Second Round Replay at Griffin Park but Marcello Trotta, his second of the night, Clayton Donaldson and Harry Forrester turned it around.
The Yorkshire side were only playing the match after winning an appeal against their expulsion from the competition.
They had played an ineligible player in the first game – a 1-1 draw in Yorkshire – but won the right to play the second tie after the FA decided the punishment was too harsh.
It looked as if they would make that reprieve count when they took the lead for the second time early in extra time but they could not hold on.
The visitors went ahead against the run of play but in the first half Brentford responded well and dominated for long periods.
The Bees equalised through a Trotta penalty but could not find a winner in normal time.
Alan Connell scored from the penalty spot early in extra time and Brentford needed to find a way to fight back.
Substitutes Forrester and Donaldson led the recovery and Brentford eventually won 4-2 and progressed to meet Southend United in the Third Round.
The Bees could have had the game won by half time with the chances they created and the Bradford defence was overworked.
Jon McLaughlin, between the sticks for the visitors, held on when Ritchie Jones almost headed in to his own net and then denied Stuart Dallas when the Northern Irish international went through one-on-one.
Trotta had a shot blocked before he was denied by McLaughlin low down and Jonathan Douglas headed over soon after.
Paul Hayes missed a golden chance when Jake Bidwell found him with a cut back ten yards out and the striker steered it wide of the far post.
Zavon Hines had an early shot blocked for Bradford and Connell missed the target after bundling his way past Tony Craig but they had been very much second best for the first quarter.
However, the game entered a lull and Bradford started to gain a foothold.
Scott Brown volleyed wide and Carl McHugh missed the target with a header but it was still a surprise when they went ahead.
Leon Legge miss-controlled in midfield and Hines broke free, the Brentford central defender got back to block the shot but Kyel Reid smashed home the loose ball.
Reid curled another effort over soon after but Brentford responded to going behind and hit back.
McLaughlin saved at the feet of Tom Adeyemi after the midfield player exchanged passes with first Sam Saunders and then Trotta before Hayes volleyed straight at the Bradford goalkeeper.
McLaughlin went full stretch to tip away a Trotta shot and Hayes volleyed over soon after.
Brentford’s equaliser came at the end of the first period, Trotta was brought down by McHugh and referee Graham Scott pointed to the penalty spot.
Trotta stroked his first Brentford goal in to the net to McLaughlin’s left as the goalkeeper dived to his right.
As was the case in the first half, Brentford dominated possession and territory after the break and it seemed a matter of time before they would break Bradford down.
Trotta had a weak shot saved after Dallas burst in to the box and Craig headed wide but there were few chances in the first 15 minutes of the second period, albeit Bradford barely had a kick.
Douglas almost opened the visitors up with a delightful pass into the inside right channel, Dallas got in behind and drilled the ball across but Hayes could not reach it to turn it in.
Trotta had a shot blocked as Brentford continued to press and a Saunders shot deflected in to the arms of McLaughlin soon after.
Antoine Gounet, on his Brentford debut, had been a virtual spectator, particularly in the second half, and when Bradford did get within shooting range, Blair Turgott fired wide.
Hayes had a shot saved and then headed wide from a Saunders corner before a Harry Forrester shot deflected in to the arms of McLaughlin.
Another Hayes effort was blocked, as was a Forrester free kick as Brentford continued to knock on the door without finding a way in.
Gounet saved an Adam Baker shot and Garry Thompson shot wide but the action was almost exclusively at the other end.
Shaleum Logan came within a whisker of putting Brentford ahead when he found Donaldson with a pass and then got the ball back from a back heel and fired a shot against the crossbar.
But Bradford went close at the other end – a Rory McArdle header was blocked and when the next corner was half cleared, Donaldson made a vital blocked to prevent a Ricky Ravenhill volley flying in.
Ravenhill fired just past the post soon after but with no more goals; the game went to extra time.
Brentford had lost the initiative slightly by the end of the game and they fell behind four minutes in to the additional 30.
Logan was adjudged to have fouled Turgott and Mr Scott again pointed to the spot.
Connell placed the penalty high to Gounet’s right to put the visitors in front.
But Brentford, as they have done so often this season, responded.
McLaughlin punched a Forrester cross off Donaldson’s head and Hayes turned a low Trotta cross wide before Toumani Diagouraga had a shot blocked.
And then the goals came.
Trotta levelled it up when he reacted first in the penalty area after a low Forrester cross was half blocked.
Donaldson put Brentford in front for the first time when the Bradford defence again did not deal with a Forrester cross and the striker fired a low left foot shot in at the near post after turning free of the defence.
And the game was safe seconds in to the second half of extra time when Trotta found Forrester and the little magician fired a left foot shot past McLaughlin and in to the far corner.
Turgott had a shot blocked in between the goals, during a crazy few minutes, and a Trotta cross-cum-shot deflected wide.
Brentford could have added more late in the game – a near post Donaldson shot was saved and a bouncing Forrester effort was also kept out by McLaughlin.
Bradford’s fire was just about extinguished by this point, Gounet stopped Nathan Curtis converting before Connell and Baker missed the target when well placed.
And when Mr Scott blew the final whistle moments later, Brentford had become the first team to beat Bradford – who are in the Northern Semi-Final of the Johnstone’s Paint Trophy and the Semi-Final of the Capital One Cup – in a cup tie this season.
Brentford: Gounet; Logan, Legge, Craig, Bidwell; Dallas (sub Donaldson 78 mins), Adeyemi (sub Diagouraga 64 mins), Douglas, Saunders (sub Forrester 71 mins); Hayes, Trotta
Subs (not used): Lee, Dean, Barron, Oyeleke
Bookings: Bidwell (79 mins) (third of season), Logan (94 mins) (fourth of season)
Bradford City: McLaughlin; Jones, McHugh, McArdle, Bass (sub Curtis 115 mins); Turgott, Ravenhill, Brown, Reid (sub Thompson 56 mins); Hines (sub Baker 67 mins), Connell
Subs (not used): Duke, Darby, Erangey, Hepworth
Bookings: Hines (67 mins)
Attendance: 2,643 (224 away fans)
By Chris Wickham