Goals from Ryan Stevenson and John Sutton gave Hearts their first win in seven games as they defeated St Johnstone at Tynecastle.
Hearts had a John Sutton effort ruled out, then Stevenson scored after Alan Mannus had parried Michael Ngoo's shot.
Saints pushed for an equaliser, Andy Webster clearing Nigel Hasselbaink's second-half header off the line.
Ngoo set up Sutton for an easy finish near the end, meaning Hearts go 10th in the Scottish Premier League.
Hearts came into this match desperate for a win after losing their previous five.
St Johnstone, meanwhile, had designs on moving up to third spot in the table.
And it was the visitors who threatened first, Rowan Vine cutting inside from the left, beating Fraser Mullen and arrowing a shot over the bar as he looked for his eighth goal of the season.
A promising Hearts attack followed soon after, Sutton headed over from Kevin McHattie's cross.
The big English striker then had a goal ruled offside in the 12th minute after knocking home Darren Barr's delivery from the right-hand-side.
Murray Davidson was back in the Saints starting XI following suspension and he worked Hearts keeper Jamie MacDonald on 15 minutes.
McDonald's opposite number Mannus bettered that save with an impressive stop when Sutton tried to lift it over the Northern Irish keeper from close range.
However, the Tynecastle side did make the breakthrough on 33 minutes.
Mannus had done well to parry Ngoo's shot after he had been set up by Arvydas Novikovas, but midfielder Stevenson pounced to net the rebound.
A few minutes later Ngoo looked to double Hearts' tally with a curling effort which went narrowly wide.
St Johnstone boss Steve Lomas decided on a pre-half-time substitution, bringing Gregory Tade on for Mehdi Abeid, which almost paid off immediately as Tade tried his luck from distance.
And before the break there was another opportunity for Ngoo, his pace taking him past Mannus but he failed to find a finish.
Saints had struggled to shackle Ngoo for much of the match and the on-loan Liverpool striker's pace continued to cause problems in the second half.
Just after the hour mark he benefited from Sutton's flick-on and flashed a volley wide.
The pendulum then swung the other way as the Perth side pushed for an equaliser.
Davidson headed Liam Craig's free-kick wide before Hearts' Webster cleared off the line from a Hasselbaink header.
And the hosts produced a sucker punch in the 83rd minute.
The troublesome Ngoo dispossessed Anderson on the byline and centred for Sutton to tap into the net to double the lead.
Saints' night was summed up when Tade's late deflected overhead kick found the net, only to be disallowed for offside.