Chelsea recovered from their shock Champions League defeat by Turkish side Besiktas to maintain their Premiership title challenge with three vital points.
Half-time substitute Hernan Crespo was the match-winning hero with a header two minutes from time.
The result ended Middlesbrough's improved run but overall the home side were unlucky not to take a point.
Chelsea were undoubtedly the better side in the first half when they appeared to be playing well within themselves, but Boro played with more spirit after the break.
The London side went ahead after 17 minutes after a mistake by George Boateng. Damien Duff pushed the ball forward following a Frank Lampard challenge and Eidur Gudjohnsen shot into the corner of the net.
Chelsea could have increased their lead after 32 minutes when skipper John Terry was unlucky to head against the woodwork.
Middlesbrough struggled for a breakthrough in the first half and one always had the impression that Chelsea could step up a gear.
After the break it was a different story as the home side showed more zest, inspired by a quick equaliser from Szilard Nemeth.
Gaizka Mendieta gave a precision pass and the Slovakia international provided the finish when he shot to the right of goalkeeper Carlo Cudicini.
Boro pushed forward in search of victory and Boateng hit a strong shot just wide of the far post, while Crespo missed a great chance at the other end when his shot struck Mark Schwarzer and knocked the goalkeeper off his feet.
Just when it looked as though Middlesbrough would finish level, Chelsea snatched a dramatic win when Duff sent over a cross to the far post and Crespo's header beat Schwarzer.
Blues boss Claudio Ranieri said: "The first half was fantastic for us but in the second half Middlesbrough played very well.
"We are not close to Arsenal or Manchester United. We must work harder to close the gap. We must improve on our tactics."About his team selection, he added: "I do not have a best 11 at the moment."