Nathan Elder scored a dramatic late winner as Brentford beat Bradford City 2-1 at Griffin Park.
The game was goalless going into the 89th-minute before Marcus Bean gave the hosts the lead, only for Michael Boulding to level the scores in injury-time to seemingly earn Bradford a deserved point.
But Elder climbed highest to head home Ryan Dickinson's free-kick to send the Bees fans wild and lift Andy Scott's side above the visitors and into fourth place in League Two.
It was tough on Bradford, who had dominated for long periods and were only denied by Brentford's on-loan goalkeeper Mikkel Andersen.
Andersen had joined on an emergency short-term deal from Reading and made four top-class saves.
But his heroics were forgotten after the crazy end to a game that had been forgettable until its final stages.
Firstly Bean picked up a loose ball on the edge of the box and guided a precise effort past Rhys Evans and into the bottom corner.
But Bradford came storming back and finally found a way past Andersen when Boulding - who has now scored in each of his last four games - hammered home from just two yards out.
The drama wasn't over, though and Dickson launched one last attack with a free-kick deep into the Bradford box and Elder headed home his sixth of the season.
Stuart McCall's visitors have only won once in their last four games and are now seven points behind leaders Wycombe.
But Brentford are up to fourth and are only out of the automatic promotion spots on goal difference, as Scott's team continue their impressive season to date.