A penalty from Grant Leadbitter late in the first half was enough to give Middlesbrough the points as Brentford were beaten in a top-of-the-table Sky Bet Championship clash at Griffin Park.
The teams started the day separated by two places and one point in the table but Middlesbrough, who began the day third, came out on top.
They may wonder how they did it, Brentford dominated the first half and were incredibly unfortunate to go in behind.
And in a more even second half Brentford still had the chances to take at least a share of the spoils.
The teams matched up with similar formations, both with one main striker and plenty of bodies in midfield.
Despite the potential for a cagey midfield battle, the game opened up early on.
Middlesbrough came with an attacking outlook, keen to get men forward and Brentford’s positive style was also clear to see.
The Bees had the first sight of goal within a minute when, following nice interplay on the left, Alex Pritchard fired wide from distance.
Pritchard crossed for Andre Gray to head wide from eight yards soon after and then set up Jota with a low free kick, the Spaniard’s shot from ten yards was superbly tipped over by Dimi Konstantopoulos.
From the resulting corner, James Tarkowski met Pritchard’s delivery and Leadbitter was forced to clear off the line.
Middlesbrough were being forced back.
They had come close to an early goal when Tarkowski made a recovery tackle as Patrick Bamford looked set to get on to a Jelle Vossen pass.
Albert Adomah had also volleyed wide for the visitors but by the midway point of the first half, they were clearly second best and were unable to get the ball to their exciting forward line.
They were very fortunate to escape when a fine Jota run set up a shooting chance for Stuart Dallas, Konstantopoulos tipped it on to the post and was then lucky to see it hit him and bounce away from the waiting Gray.
A lofted effort from Douglas, after Jota had split the defence, was saved and a Pritchard shot moments later was blocked and deflected away from Gray.
A Douglas header from a Jota free kick was blocked soon after as Brentford moved through the gears in an attempt to turn their domination in to a lead.
Leadbitter, who appeared to be holding Middlesbrough together on his own at times in the first half, sliced a shot horribly wide from a short corner but the visitors spent most of the first half penned back in their own territory.
Their attacking potential was obvious on the break, however, and they almost scored against the run of play late in the first period.
A Lee Tomlin shot hit Vossen, who then picked up the loose ball and crossed to the back past when it took a fine tackle from Moses Odubajo to prevent Albert Adomah scoring.
Tarkowski headed a Pritchard free kick wide before the visitors snatched the lead in the dying seconds of the first half.
Bamford got on to the end of a long ball over the top and was fouled by David Button as he attempted to round the Brentford goalkeeper.
Referee Simon Hooper pointed to the penalty spot and booked Button.
Leadbitter took the responsibility and sent Button the wrong way to give Middlesbrough the lead.
Brentford went in at the break very unfortunate to be behind on the balance of play but they did not let it affect them after the restart.
They continued to attack and play with confidence and with Middlesbrough now looking to break quickly, it made for a very entertaining second half.
Button made a good low save from a Vossen header just after the break and the visiting striker then headed the next corner just past the far post.
At the other end Jota forced Konstantopoulos in to a low save before delivering a corner that Dallas volleyed just over.
Button made a good low save from Bamford before Adomah failed to convert a Vossen cross soon after following a quick break.
Leadbitter couldn’t turn in another Vossen cross soon after while at the other end Dallas cut inside and whistled a shot inches over the bar.
Chances were coming regularly at both ends as the game entered its final quarter.
Vossen turned a Bamford cross wide and Jonathan Douglas had a shot blocked for Brentford, who were still dominating possession as the game entered the final 20 minutes.
Middlesbrough, befitting of the team with the best defensive record in the division, were incredibly tough to break down.
Most of Brentford’s possession was in front of a well-drilled back line and The Bees were working hard to find a way through.
Harlee Dean headed a Pritchard free kick over and from another set piece soon after, the ball dropped loose and Tarkowski smashed it in to the side netting.
Tomlin had a shot blocked for the visitors at the other end and then shot over soon after when he was set up by substitute Adam Forshaw.
In the last few minutes Brentford were camped deep in Middlesbrough territory.
Tarkowski shot in to the side netting and a Dallas volley was superbly blocked.
In the dying seconds Button went up for a corner and confusion reigned, Jake Bidwell knocked it back in to the box, Douglas swivelled and shot and Konstantopoulos made a point blank save to ensure his team took the win.
Brentford: Button; Odubajo, Dean (sub Smith 89 mins), Tarkowski, Bidwell; Douglas, Diagouraga (sub Toral 76 mins); Jota, Pritchard, Dallas; Gray (sub Long 76 mins)
Subs (not used): Bonham, Yennaris, Craig, Saunders
Bookings: Diagouraga (33 mins) (fourth of season), Button (43 mins) (fourth of season), Douglas (62 mins) (seventh of season)
Middlesbrough: Konstantopoulos; Fredericks, Gibson, Omeruo, Friend; Leadbitter, Clayton; Bamford (sub Kike 88 mins), Tomlin, Adomah (sub Forshaw 68 mins); Vossen (sub Reach 80 mins)
Subs (not used): Mejías, Ledesma, Whitehead, Woodgate
Bookings: Omeruo (16 mins), Bamford (40 mins), Kike (90 mins)
Attendance: 11,853 (1,662 away fans)
By Chris Wickham