George Friend’s 86th-minute own goal sent Middlesbrough tubmling to defeat at Cardiff.
A game in which defences had been on top throughout appeared to be drifting towards a draw.
But after goalkeeper Dimitrios Konstantopoulos saved Matthew Connolly’s point-blank header he was helpless when substitute Sammy Ameobi’s shot struck Friend and flew into his net.
Both teams went into the game on the back of goalless draws andlacked the clinical edge to break down the other’s durable defence.
Boro have now gone now three games without a goal, but Grant Leadbitter was denied on the line by Lee Peltier’s goalline clearance.
The 13,371 crowd was the lowest league attendance in the six-year history of the Cardiff City Stadium, but Bluebirds’ fans celebrated their lucky break at the end as they moved within a point of Middlesbrough in the Championship table.
Cardiff were quick to pick up the second balls in and around the Boro box, but most efforts were directed too close to Konstantopoulos.
The exception was Craig Noone’s effort from 20 yards, which saw the former Cardiff goalkeeper react quickly to his right to palm the ball away.
But Boro defended well with Konstantopoulos making a series of regulation saves.
Cardiff: Marshall, Peltier, Morrison, Connolly, Da Silva, Noone, Gunnarsson (O’Keefe 80), Dikgacoi, Whittingham, Mason (Malone 90), Revell (Ameobi 76). Unused substitutes: Pilkington, Tamas, Moore, Kennedy.
Middlesbrough: Konstantopoulos, Kalas, Ayala, Amorebieta, Friend, Clayton, Leadbitter (Forshaw 80), Adomah (Garcia 89), Fabbrini (Nsue 84),Downing,Nugent. Unused substitutes: Gibson, De Pena, Mejias, Stephens.
Referee: Dean Whitestone (Northants).