Huddersfield Town took a giant stride towards Championship safety by beating a lacklustre Cardiff City 2-1.
The Terriers are now three points clear of the drop zone and a point from their last two games will be enough to keep them in the division.
Joseph Hungbo fired Huddersfield ahead after a mistake, before a Jack Simpson own goal made the points safe.
Cardiff responded with a goal from substitute Isaak Davies but the visitors held on for a deserved win.
Huddersfield also struck the woodwork twice as they dominated Cardiff after the interval to secure one of their most important victories of the campaign.
The result lifts the Terriers up to 20th and they know just a draw from their two final games - both at home, against Sheffield United and Reading - will secure their Championship survival.
A few weeks ago, even a few days ago, this looked like being a high-stakes contest for both sides after a season where both clubs have struggled.
However, that danger had dissipated for the Bluebirds who came into their final home game knowing their Championship status is secure for another season.
Unquestionably this was a bigger game for the visitors, with Huddersfield only outside of the bottom three on goal difference as Terriers boss Neil Warnock returned to one of his former clubs.
Warnock enjoyed huge success at Cardiff, leading the club to the Premier League, and will feel vindicated by his decision to reverse his retirement to keep the Terriers up, with that job now close to completion.
There was certainly no mistaking this was a game between two struggling sides in a first half high on effort and short on quality, underlining exactly why Cardiff and Huddersfield have averaged less than a goal per game all season.
A shot from former Cardiff striker Danny Ward that was well saved by Jac Alnwick in the third minute was the only effort on target from either side until the 40th minute, when Josh Koroma also forced Alnwick to push the ball to safety.
Cardiff did threaten a couple of times with Romaine Sawyers and Jaden Philogene missing the target, while Sawyers did well to block Jack Rudoni's effort, but the match was goalless at the interval.
The contest was so lacking in quality it seemed almost certain only a mistake would lead to the deadlock being broken and that is exactly what happened.
The opening goal was entirely of Cardiff's making as Sawyers was caught in possession as he attempted an under-hit backpass which Hungbo intercepted, with the substitute showing great composure to beat Cedric Kipre's challenge and fire into the roof of the net.
The visitors doubled their advantage when Cardiff defender Simpson inadvertently touched home Matty Pearson's header as the Bluebirds failed to deal with a routine free-kick.
It was the visitors who looked likely to add to the scoring, with Koroma cracking the post and Jaheim Headley hitting the crossbar from the rebound, before Jordan Rhodes and Tom Lees both headed off target.
The Terriers were rampant but they ended the game nervously as Davies cleverly flicked home from a short-corner routine.
However, it was not to be for Cardiff who suffered further disappointment as Joe Ralls was forced off through injury in the second half on his 350th appearance for the Bluebirds.
Cardiff simply never looked like responding to Huddersfield's frantic 10 minutes in the second half as they continue their dismal home form this season, despite Rubin Colwill forcing Lee Nicholls into a fine late save.
The Bluebirds have won just two of their past 15 home league games and are now winless in five at the Cardiff City Stadium where they have only won six times times all season.
Cardiff City: Alnwick, Romeo (R. Colwill 73’), McGuinness, Wintle, Ralls © (Davies 55’), Etete (Kaba 14’), Ojo, Sawyers (Wickham 73’), Kipre (Rinomhota 73’), Philogene, Simpson. Subs not used: Luthra, Ng.
Huddersfield Town: Nicholls, Pearson, Hogg ©, Koroma (Kasumu 82’), Ruffels, Rudoni, Ward (Rhodes 65’), Lees, Diarra (Hungbo 46’), Helik, Headley. Subs not used: Vaclík, Edmonds-Green, Jackson, Waghorn.