Hereford United struck a stoppage time winner to knock Brentford out of the Carling Cup at the First Round stage.
Substitute Yoann Arquin helped The Bulls reach the Second Round, very much against the flow of the game.
Brentford dominated from the first whistle and while Hereford had the odd breakaway, it was only in the last ten minutes they created a series of openings.
And with one of those they stole the game and a place in the Second Round.
Brentford were completely dominant in the early stage - goalkeeper Simon Moore was almost redundant and The Bees could have been out of sight by the time 20 minutes had elapsed.
Charlie MacDonald should have scored inside 45 seconds when he drilled a low shot against the legs of Adam Bartlett at the end of a fine move involving Jonathan Douglas, Clayton Donaldson and Marcus Bean.
Sam Saunders fired a free kick awarded when Bartlett picked up a Rob Purdie back pass 16 yards out in to a defensive wall and Douglas curled a shot over.
Bartlett denied Donaldson after he exchanged passes with MacDonald and when Kevin O'Connor tried to slot home the re-bound, Purdie blocked on the line.
The Hereford goalkeeper saved again from a Donaldson header soon after but as the game edged towards the half hour it became a little more even.
Hereford started to create openings - Stuart Fleetwood shot just over after running on to a Delroy Facey flick and then curled a free kick in to the defensive wall.
Karleigh Osborne made a fine block from a curling Harry Pell shot and while Brentford continued to pose problems in the final third, particularly from crosses, they couldn't open Hereford up before the break.
The Bees continued to hold the upper hand after the re-start, without being able to break the deadlock.
Stefan Stam made an important tackle to prevent MacDonald going through in the early stages of the half and as it wore on The Bees began to lay siege to the home goal.
Saunders shot wide, Donaldson had shot deflected wide before he forced Bartlett to save at his feet.
MacDonald was just unable to convert a Bean cross, Donaldson brought a fine low save out of Bartlett and O'Connor had a shot deflected wide.
Brentford continued to create openings - Donaldson had a shot blocked and then lifted an effort over the bar after capitalising on a Stam error.
Bean chipped a shot narrowly over for the visitors while, on a rare Hereford attack, substitute Arquin had an effort blocked.
The hosts ended the 90 minutes better - Moore had to make a fine save to tip over a Pell volley and then denied the same man from the resulting corner before he kept out an Arquin header.
Donaldson had a shot deflected wide as Brentford sought a winner but they were caught by a sucker punch.
Joe Colbeck escaped down the right from a long ball and put in a cross for Arquin to convert at the back post.
Sam Wood had a shot blocked and Marcel Eger flashed a late drive wide before referee Philip Gibbs brought an end to a night where Brentford did everything but score and Hereford went through.
Hereford United: Bartlett; Purdie, Green, Stam, Heath; Lunt; Colbeck, Pell, McQuilkin, Fleetwood; Facey (sub Arquin 69 mins)
Subs (not used): Hoult, Weir, Williams, McCarthy, Kovacs, Canham
Bookings: Colbeck (40 mins)
Brentford: Moore; Logan (sub Alexander 90 mins), Osborne, Eger, Wood; Bean (sub Weston 86 mins), Douglas, O'Connor; Saunders (sub Reeves 74 mins); Donaldson, MacDonald
Subs (not used): Lee, Balkestein, Woodman, Forrester
Bookings: Douglas (68 mins)
Attendance: 1,767 (190 Bees fans)
By Chris Wickham