A memorable strike from substitute Albert Adomah secured a vital victory for Bristol City and lifted them off the foot of the Championship.
The Ghanaian found the top corner from 18 yards before Steven Davies added a second shortly after the break as City continued their unbeaten run at Ashton Gate since Sean O'Driscoll took charge.
Middlesbrough, without an away win since 8 December, struggled throughout.
The result leaves Tony Mowbray's men three points off the play-off spots.
City made the brighter start, with Marvin Elliott teeing up Neil Kilkenny early on, only for Boro goalkeeper Jason Steele to keep his curling effort out.
The visitors tried their luck with a long-range shot but Tom Heaton, who had kept back-to-back clean sheets in his previous matches, was not troubled by Marvin Emnes's ambitious drilled effort.
When Jon Stead picked up a knock, O'Driscoll turned to Adomah, whose opportunities have been limited to late cameos since returning from the Africa Cup of Nations.
It was not long before the Ghana international latched onto Kilkenny's raking 40-yard pass and curled the ball into the top corner off the inside of the post.
Middlesbrough did respond, first when Mustapha Carayol shot over the crossbar, then when Elliott headed over on the stroke of half-time.
But seven minutes into the second half, City doubled their lead as Davies latched onto a quickly-taken free-kick and fired the ball home from an angle.
City felt they should have been awarded a penalty when Davies's shot hit Rhys Williams' hand inside the box, while Adomah turned creator on 74 minutes to fashion a chance for Elliott, who could only drill a first-time effort wide.
Middlesbrough boss Tony Mowbray: "I have to put a positive spin on our position because if we were just off the play-off places having been mid-table all season we would be happy enough.
"Because we have fallen away from the top of the table since the New Year, in a similar way to last season, there is a lot of negativity and I have to turn that around. "
Bristol City head coach Sean O'Driscoll: "I can't fault the players since I have been at the club.
"They understand what we are trying to do, but it is one thing to talk about a plan and another to do what is necessary to carry it out.
"I never look at the league table because I don't believe there is any point. I believe in keeping on with the same emphasis on the basics and getting my team organised whatever position they are in. When we lose the ball we look to get it back as quickly as possible."
- 01 Heaton
- 04 Fontaine
- 05 Nyatanga
- 17 Cunningham
- 19 Moloney
- 08 Kilkenny
- 10 Kelly
- 15 Pearson
- 25 Elliott
- 09 Stead (Adomah - 17' )
- 16 Davies (Baldock - 80' )
- 22 Gerken
- 12 Wilson
- 39 Bates
- 11 Howard
- 21 Anderson
- 27 Adomah (Howard - 89' )
- 07 Baldock
- 01 Steele
- 04 Friend (Halliday - 46' )
- 06 McManus Booked
- 14 Williams
- 39 Woodgate
- 10 Bailey (Ledesma - 75' )
- 12 Dyer
- 33 Smallwood
- 09 Emnes (Main - 54' )
- 19 Carayol
- 27 McDonald
- 32 Leutwiler
- 15 Hines
- 25 Reach
- 18 Halliday
- 11 Ledesma
- 23 Main
- 30 Miller
Live Text Commentary
Full Time The final whistle is blown by the referee.90:00 +4:58
Mustapha Carayol takes a shot. Save by Tom Heaton.90:00 +4:18
Neil Kilkenny has an effort at goal. Jason Steele makes a save.90:00 +1:05
Short corner taken by Stephen Pearson from the right by-line.90:00 +0:32
Free kick awarded for an unfair challenge on Liam Kelly by Andrew Halliday. Free kick taken by Brendan Moloney.88:12 Substitution
Substitution Brian Howard replaces Albert Adomah.87:47 Booking
Booking Booking for Stephen McManus.79:27 Substitution
Substitution Sam Baldock on for Steven Davies.78:15
Steven Davies gives away a free kick for an unfair challenge on Rhys Williams. Direct free kick taken by Rhys Williams.76:14
Short corner taken by Stephen Pearson.75:58
Steven Davies takes a shot. Save by Jason Steele.74:26 Substitution
Substitution (Middlesbrough) makes a substitution, with Emmanuel Ledesma coming on for Nicky Bailey.74:13
Marvin Elliott produces a right-footed shot from outside the penalty box and misses right.68:04
Greg Cunningham fouled by Mustapha Carayol, the ref awards a free kick. Direct free kick taken by Tom Heaton.67:25
Unfair challenge on Rhys Williams by Stephen Pearson results in a free kick. Rhys Williams restarts play with the free kick.66:27
Free kick awarded for a foul by Rhys Williams on Greg Cunningham. Tom Heaton restarts play with the free kick.63:13
The assistant referee flags for offside against Scott McDonald. Tom Heaton takes the free kick.60:09
Steven Davies produces a left-footed shot from outside the penalty area and misses left.58:08
Unfair challenge on Nicky Bailey by Steven Davies results in a free kick. Jonathan Woodgate takes the direct free kick.57:03
Corner taken by Richard Smallwood from the left by-line played to the near post, clearance by Liam Kelly.
Curtis Main takes a shot. Neil Kilkenny gets a block in.55:30
Free kick awarded for an unfair challenge on Greg Cunningham by Curtis Main. Tom Heaton takes the free kick.53:03 Substitution
Substitution Curtis Main joins the action as a substitute, replacing Marvin Emnes.51:48
Assist on the goal came from Stephen Pearson.51:48 Goal scored
Goal! - Steven Davies - Bristol C 2 - 0 Middlesbro Goal scored by Steven Davies from just inside the penalty area to the bottom right corner of the goal. Bristol City 2-0 Middlesbrough.51:28
Richard Smallwood concedes a free kick for a foul on Albert Adomah. Direct free kick taken by Neil Kilkenny.49:05
Corner taken by Richard Smallwood from the right by-line, save made by Tom Heaton.47:05
Outswinging corner taken right-footed by Richard Smallwood from the right by-line, Marvin Emnes challenges Tom Heaton unfairly and gives away a free kick. Direct free kick taken by Tom Heaton.45:01
The game restarts for the second half.45:01 Substitution
Substitution Andrew Halliday comes on in place of George Friend.45:00 +2:07 Half time
Half Time The half-time whistle blows.45:00 +1:14
Corner from the right by-line taken by Stephen Pearson, Marvin Elliott produces a header from inside the six-yard box that clears the bar.44:24
Jonathan Woodgate gives away a free kick for an unfair challenge on Steven Davies. Neil Kilkenny takes the free kick.43:03
Albert Adomah gives away a free kick for an unfair challenge on George Friend. Richard Smallwood delivers the ball from the free kick right-footed from left wing, Lewin Nyatanga manages to make a clearance. Effort on goal by Mustapha Carayol from just inside the penalty area goes harmlessly over the target.39:51
The referee blows for offside. Tom Heaton restarts play with the free kick.39:01
The ball is crossed by Marvin Emnes, Tom Heaton makes a save.31:36 Goal scored
Goal! - Albert Adomah - Bristol C 1 - 0 Middlesbro Albert Adomah finds the back of the net with a fantastic goal from the edge of the area to the top left corner of the goal. Bristol City 1-0 Middlesbrough.29:33
Foul by Marvin Elliott on Scott McDonald, free kick awarded. Direct free kick taken by Richard Smallwood.27:52
Inswinging corner taken by Richard Smallwood from the left by-line, Liam Fontaine makes a clearance.26:14
Free kick awarded for an unfair challenge on Scott McDonald by Marvin Elliott. Richard Smallwood restarts play with the free kick.25:17
The assistant referee flags for offside against Kieron Dyer. Tom Heaton takes the indirect free kick.24:57
Volleyed right-footed shot by Steven Davies. Save by Jason Steele.23:36
Free kick awarded for a foul by Rhys Williams on Steven Davies. Steven Davies has an effort direct from the free kick.20:59
Free kick awarded for a foul by Liam Kelly on Marvin Emnes. The free kick is swung in right-footed by Richard Smallwood, save made by Jason Steele.18:43
Marvin Emnes fouled by Liam Fontaine, the ref awards a free kick. Direct free kick taken by Marvin Emnes.16:35 Substitution
Substitution Albert Adomah is brought on as a substitute for Jon Stead.14:05
Kieron Dyer is flagged offside by the assistant referee. Indirect free kick taken by Tom Heaton.13:24
Marvin Emnes has an effort at goal from 25 yards. Save by Tom Heaton.12:00
Stephen McManus concedes a free kick for a foul on Jon Stead. Steven Davies restarts play with the free kick.10:32
Shot by Neil Kilkenny. Jason Steele makes a save.4:43
Effort from 35 yards by Marvin Elliott went wide of the right-hand upright.4:05
Scott McDonald concedes a free kick for a foul on Marvin Elliott. Tom Heaton takes the free kick.1:33
The assistant referee flags for offside against Marvin Emnes. Tom Heaton restarts play with the free kick.0:00
The referee starts the match.
Live data and text provided by our data suppliers