Clayton Donaldson netted the winner as Brentford came from behind to beat promotion rivals Swindon.
Simon Ferry drilled home for a second consecutive game to give the visitors a first-half lead.
Substitute Sam Saunders brought the Bees level from the penalty spot after goalkeeper Wes Foderingham felled Donaldson in the box.
And the in-form striker scored his 21st of the season four minutes later, thundering the ball under Foderingham.
Swindon had their keeper to thank for keeping the score down, as he saved well from both Donaldson and Bradley Wright-Phillips.
The result means Brentford leapfrog the Robins into third and close the gap on second-placed Sheffield United to one point, although the Blades have a game in hand.
Kevin MacDonald's Swindon slip down to fourth, ahead of Tranmere and Yeovil on goal difference.
VIEWS FROM THE DRESSING ROOM
Swindon Town manager Kevin MacDonald told BBC Wiltshire:
"I thought we were the better side, especially in the first half.
"We're disappointed because we felt we should have won the game. We probably had enough chances to win two games.
"But in the end Brentford got a could of breakaways and won it.
"It's hard to fathom why, as we were so comfortable."
Sorry, we were unable to load match stats, please try again.
Live Text Commentary
Full Time The final whistle is blown by the referee.90:00 +4:58
Free kick awarded for an unfair challenge on Nathan Thompson by Clayton Donaldson. Indirect free kick taken by Wes Foderingham.90:00 +3:57
Clayton Donaldson is penalised for a handball. Wes Foderingham restarts play with the free kick.90:00 +3:04
Jay McEveley takes a shot. Jonathan Douglas gets a block in.90:00 +1:40
Wes Foderingham takes the indirect free kick.90:00 +1:40 Booking
Booking Bradley Wright-Phillips goes into the book.90:00 +1:27
Free kick awarded for an unfair challenge on Alan McCormack by Bradley Wright-Phillips.90:00 +1:14
The assistant referee flags for offside against Clayton Donaldson. Wes Foderingham takes the free kick.90:00 +0:19
Free kick awarded for a foul by James Collins on Harlee Dean. Indirect free kick taken by Simon Moore.88:25
Simon Moore takes the indirect free kick.88:25 Substitution
Substitution Andy Williams leaves the field to be replaced by Raffaele De Vita.88:25
James Collins challenges Harlee Dean unfairly and gives away a free kick.87:21
Inswinging corner taken by Sam Saunders, save by Wes Foderingham.87:09
Clayton Donaldson takes a shot. Blocked by Aden Flint.85:01
The free kick is delivered right-footed by Sam Saunders from left wing, save by Wes Foderingham.85:01 Booking
Booking Nathan Thompson receives a yellow card for unsporting behaviour.84:48
Unfair challenge on Toumani Diagouraga by Nathan Thompson results in a free kick.82:57 Substitution
Substitution Toumani Diagouraga replaces Tom Adeyemi.82:57 Substitution
Substitution James Collins on for Tommy Miller.81:40
Corner taken by Sam Saunders played to the near post, clearance by Tommy Miller.
Bradley Wright-Phillips takes a shot. Save by Wes Foderingham.80:28
Luke Rooney takes the outswinging corner, clearance made by Clayton Donaldson.78:54
The offside flag is raised against Luke Rooney. Indirect free kick taken by Simon Moore.78:10
Andy Williams fouled by Sam Saunders, the ref awards a free kick. Aden Flint takes the indirect free kick.76:55 Substitution
Substitution (Swindon) makes a substitution, with Luke Rooney coming on for Gary Roberts.75:29
Assist by Tom Adeyemi.75:29 Goal scored
Goal! - Clayton Donaldson - Brentford 2 - 1 Swindon Goal scored by Clayton Donaldson from inside the box low into the middle of the goal. Brentford 2-1 Swindon.73:06
Tommy Miller gives away a free kick for an unfair challenge on Tom Adeyemi. Shot on goal comes in from Sam Saunders from the free kick, save by Wes Foderingham.71:54 Goal scored
Goal! - Sam Saunders - Brentford 1 - 1 Swindon Power penalty scored by Sam Saunders. Brentford 1-1 Swindon.70:54 Booking
Booking Wes Foderingham goes into the book for unsporting behaviour.70:33
Penalty awarded for a foul by Wes Foderingham on Clayton Donaldson.68:42
Free kick awarded for an unfair challenge on Jonathan Douglas by Gary Roberts. Sam Saunders takes the free kick.65:59
Harlee Dean takes the outswinging corner, Jay McEveley manages to make a clearance.65:27
Simon Ferry concedes a free kick for a foul on Adam Forshaw. Free kick taken by Simon Moore.64:30
Shaleum Logan fouled by Gary Roberts, the ref awards a free kick. Sam Saunders takes the indirect free kick.63:26
Bradley Wright-Phillips takes a shot. Blocked by Alan McCormack.62:49
Adam Forshaw fouled by Jay McEveley, the ref awards a free kick. Indirect free kick taken by Simon Moore.61:03 Substitution
Substitution Marcello Trotta leaves the field to be replaced by Bradley Wright-Phillips.60:50
Alan McCormack is flagged offside by the assistant referee. Free kick taken by Simon Moore.59:59
Corner taken left-footed by Gary Roberts.59:11
Corner taken by Gary Roberts from the left by-line.56:16
Alan McCormack concedes a free kick for a foul on Liam Moore. Direct free kick taken by Adam Forshaw.55:42 Substitution
Substitution Sam Saunders replaces Stuart Dallas.54:56
Alan McCormack produces a cross, Darren Ward takes a shot. Save made by Simon Moore.54:56 Booking
Booking Shaleum Logan receives a caution.53:36
Free kick awarded for an unfair challenge on Marcello Trotta by Aden Flint. Adam Forshaw takes the free kick. Foul by Shaleum Logan on Gary Roberts, free kick awarded.51:32
Unfair challenge on Stuart Dallas by Adam Rooney results in a free kick. Stuart Dallas takes the free kick.50:14
Foul by Adam Forshaw on Gary Roberts, free kick awarded. Indirect free kick taken by Tommy Miller.49:20
Tommy Miller produces a right-footed shot from just outside the area that goes harmlessly over the target.48:45
Corner taken by Gary Roberts from the right by-line, Liam Moore makes a clearance.46:36
Adam Forshaw takes a inswinging corner.45:01
The referee gets the second half started.45:00 +1:09 Half time
Half Time The players leave the pitch at half time.45:00 +0:52
Andy Williams takes a shot. Blocked by Harlee Dean.44:28
The referee penalises Andy Williams for handball. Indirect free kick taken by Simon Moore.43:14
Unfair challenge on Andy Williams by Harlee Dean results in a free kick. Wes Foderingham takes the free kick.42:08
Adam Rooney fouled by Jonathan Douglas, the ref awards a free kick. Indirect free kick taken by Aden Flint.41:45
Unfair challenge on Harlee Dean by Aden Flint results in a free kick. Indirect free kick taken by Simon Moore.41:11
Tommy Miller takes the indirect free kick.41:11 Booking
Booking Liam Moore is shown a yellow card for unsporting behaviour.41:02
Andy Williams fouled by Liam Moore, the ref awards a free kick.40:01
Adam Forshaw takes a shot. Aden Flint gets a block in.38:00
Free kick awarded for an unfair challenge on Gary Roberts by Shaleum Logan. Jay McEveley takes the direct free kick.36:45
Free kick awarded for a foul by Simon Ferry on Liam Moore. Simon Moore takes the free kick.35:01
Inswinging corner taken from the left by-line by Adam Forshaw, Aden Flint makes a clearance.33:47
Corner taken right-footed by Adam Forshaw from the right by-line, Effort from the edge of the area by Jonathan Douglas goes wide of the right-hand post.32:47
Shot by Gary Roberts from deep inside the penalty area misses to the right of the goal.31:28
Assist by Gary Roberts.31:28 Goal scored
Goal! - Simon Ferry - Brentford 0 - 1 Swindon Simon Ferry gets on the score sheet with a goal from inside the area to the bottom left corner of the goal. Brentford 0-1 Swindon.30:14
The referee blows for offside. Indirect free kick taken by Simon Moore.29:51
Corner taken left-footed by Gary Roberts from the left by-line, Adam Forshaw makes a clearance.29:32
Outswinging corner taken by Gary Roberts.28:21
Free kick awarded for a foul by Stuart Dallas on Nathan Thompson. Free kick taken by Wes Foderingham.27:28
Corner from the right by-line taken by Stuart Dallas, clearance made by Gary Roberts.27:06
Corner taken by Stuart Dallas played to the near post, Darren Ward makes a clearance.23:52
Effort from the edge of the area by Stuart Dallas goes wide of the left-hand upright.22:34
Inswinging corner taken left-footed by Gary Roberts, Clayton Donaldson makes a clearance.22:06
Foul by Tom Adeyemi on Simon Ferry, free kick awarded. Gary Roberts takes the free kick.19:43
Effort from the edge of the area by Clayton Donaldson goes wide of the right-hand post.18:12
Unfair challenge on Adam Forshaw by Alan McCormack results in a free kick. Tony Craig takes the indirect free kick.15:26
The assistant referee flags for offside against Marcello Trotta. Wes Foderingham restarts play with the free kick.13:32
The referee blows for offside. Wes Foderingham takes the free kick.9:47
Corner taken by Gary Roberts from the left by-line, Alan McCormack takes a shot. Save by Simon Moore.7:14
Unfair challenge on Jonathan Douglas by Gary Roberts results in a free kick. Shaleum Logan takes the free kick.6:24
Clayton Donaldson fouled by Adam Rooney, the ref awards a free kick. Free kick taken by Adam Forshaw.5:54
Jay McEveley takes a shot. Save by Simon Moore.2:39
Clayton Donaldson is flagged offside by the assistant referee. Wes Foderingham takes the free kick.2:09
Free kick awarded for a foul by Tommy Miller on Clayton Donaldson. Free kick taken by Tony Craig.1:26
Tommy Miller takes a shot. Blocked by Harlee Dean.1:05
Corner taken left-footed by Gary Roberts, Shaleum Logan makes a clearance.0:21
Inswinging corner taken from the right by-line by Gary Roberts, clearance made by Marcello Trotta.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers