Alex McLeish secured his first victory as Nottingham Forest manager with a deserved home win over Peterborough.
Forest should have taken the lead when Radoslaw Majewski fired over from eight yards and did so when Greg Halford headed in from Henri Lansbury's corner.
The visitors equalised as George Boyd's corner hit Lansbury and fell for Scott Wootton to convert from close range.
But McLeish's men snatched a late winner through Elliot Ward's powerful header, following a Majewski corner.
The victory moves Forest up to ninth, while Peterborough continue to linger around the Championship relegation zone.
Forest started well and Dan Harding's cross found Majewski, who skied his effort when he should have hit the target.
However, they did not have long to wait - Halford's header looked to have been cleared off the line, but the referee's assistant gave the goal.
Posh could have been level moments later as Davide Petrucci found himself in space on the edge of the box, only to shoot wide.
There were appeals for a Forest penalty when Simon Cox went down under the challenge of Wootton, but referee Eddie Ilderton was unmoved.
Billy Sharp had two chances to double Forest's lead, firing wide from Chris Cohen's cross and then seeing a header brilliantly saved by Robert Olejnik.
Olejnik was called into action early in the second half as Cox almost met a Cohen pass, but the goalkeeper rushed out and smothered.
Darren Ferguson introduced 17-year-old Jaanai Gordon-Hutton in an attempt to lift his side and it worked as Boyd's set-piece struck Lansbury and fell kindly for Wootton, who hammered home.
The home side should have taken the lead as Cox played the ball across the box, but Majewski shot wide when it looked easier to score.
But seven minutes from time Majewski swung in a corner which Ward powerfully headed in.
Nottingham Forest manager Alex McLeish:
"It's no secret that we are still looking to bolster the squad. If we are going to have a real go at the play-offs we need three or four players to come through the door.
"I thought we showed a lot of character against Peterborough to come back from what was a horrible result in the FA Cup last weekend (3-2 defeat by Oldham).
"And we showed more of that character during the game to come back and get the winner after Peterborough had equalised.
"We were a wee bit nervous for a time after they scored but credit to the players for sticking at it."
Peterborough boss Darren Ferguson:
"To lose two goals and the game to two set-pieces is very disappointing because I thought a draw would have been a fair result.
"I am repeating myself a lot this season but I told the players afterwards that it was another game we should not have lost but it was frustrating to concede the way we did.
"Things went against us at times. I have seen the first goal and I'm still not convinced that it was over the line but the referee's assistant decided from 40 yards away that it was.
"We should have also had what I thought was a blatant penalty but there's no point in talking to officials about things like that."