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.
Heart of Midlothian 01 MacDonald 04 Wilson 05 Barr Booked 06 Webster 29 McHattie 30 Mullen Booked 07 Stevenson 10 Taouil (Holt - 77' ) 09 Sutton (Smith - 87' ) 18 Novikovas (Walker - 65' Booked ) 21 Ngoo Substitutes 13 Ridgers 14 Walker 15 Holt 16 Prychynenko 27 Tapping 12 Smith 37 Carrick St Johnstone 01 Mannus 02 MacKay Booked 03 Davidson Booked 05 Wright (Anderson - 46' ) 18 McCracken 04 Cregg 08 Davidson Booked 10 Craig 21 Abeid (Tade - 40' ) 17 MacLean 23 Vine (Hasselbaink - 62' ) Substitutes 15 Tuffey 06 Anderson 26 Caddis 07 Millar 14 Gwion Edwards 09 Tade 11 Hasselbaink