Paddy McNair converted a late penalty to put Middlesbrough on track for a 2-0 win over Peterborough at the Riverside Stadium.
The Boro defender picked himself up off the floor having been brought down by Nathan Thompson to score the decisive opener with five minutes remaining.
And in stoppage time 18-year-old Josh Coburn stroked in the second to frustrate Peterborough, who have now lost all six of their away games since returning to the Sky Bet Championship.
It had looked like Peterborough, sitting in the relegation zone, would pick up a first point on the road in a game that had been starved of clear-cut chances.
Middlesbrough, who are now five points shy of the top six after winning for the third time in 10 games, had struggled to seriously test Peterborough goalkeeper David Cornell.
Neither goalkeeper had to make a save until Cornell got down low to comfortably gather Marcus Tavernier's effort in the 42nd minute.
Before that, there were a few scares for the defenders but very little to really threaten.
Andraz Sporar headed wide from Onel Hernandez's cross early on and Duncan Watmore's run from his own half ended with Cornell holding the low cross quarter of an hour later.
The nearest Peterborough, who started brightly with a couple of probing attacks, came to scoring was when Jorge Grant headed over Sammie Szmodics' centre six minutes before the break.
Hernandez had also seen a late effort cleared off the line by Josh Knight when he was played in behind his marker and he had beaten the keeper with his shot.
The biggest positive for Middlesbrough at that point was they had kept a clean sheet, having entered into this game without their first-choice back four. Anfernee Dijksteel, Marc Bola, Dael Fry and Grant Hall are all injured and Lee Peltier was also suspended.
Middlesbrough were quick to create a chance after the restart too. Uche Ikpeazu's delivery was headed wide by Slovenian Sporar.
Almost immediately Peterborough had shouts for a penalty waved away at the other end when goalkeeper Joe Lumley missed the ball and appeared to catch Siriki Dembele.
After that, Middlesbrough created a couple of openings with balls whipped across the six-yard box, but there was frustration as a red shirt could not get on the end of it.
Hernandez also created an opening when his low drive had to be held by Cornell, but once again there was no way through.
But in the closing stages, McNair was pulled to the ground by Thompson and referee John Busby pointed to the spot. McNair got up and sent Cornell the wrong way.
And then teenage substitute Coburn sealed the points with a tidy finish in stoppage time after exchanging passes with Martin Payero.
What the managers said...
Middlesbrough's Neil Warnock: "I couldn't fault them, every one of them has been super. They all know they are playing out of position, a lot of them anyway, we have nothing else so I asked them to enjoy the battle. I told them 'Don't dwell on any mistakes, just get on with it and enjoy it'. I thought the crowd were quite patient today too. The majority of fans know. Quite simply we could have had another eight or nine points this season with a bit of luck.
"As a manager you can't do any more. You have to put the team out. If we had got beaten we couldn't complain about the effort. The squad is decimated, it is difficult. That's life. In the first half we tried to take an extra touch, created some great chances second half across the box. It was a really good performance today, Sol Bamba was outstanding, Duncan Watmore, he got cramp, that doesn't surprise me either after his work. We haven't been able to work with anything. Thursday night I didn't have a clue what my team was going to be."
Peterborough's Darren Ferguson: "It was a penalty (Dembele's). He has got it wrong. Very wrong on that one. It was a blatant penalty. The referee is not going to be taking charge of the training session on Monday or our next game. I have to concentrate on what we have done wrong. I have been told it is a definite penalty.
"He has then given them a penalty. But that can't affect us moving forward and what we are doing is not good enough. I feel we have the players and we have to start showing it. This was a game we could come and win. The fans were getting frustrated here. They weren't carving us open, they weren't creating loads of chances. I haven't seen the second penalty decision. That was partly the reason why we conceded the second goal. It was there for the taking. The way the game was going we were in control for large parts but the quality wasn't there in the final third."