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 boss Sabri Lamouchi told BBC Sport Wales:
“It is not exactly like that we want to finish our season but as I said to the players, one month ago… we would have paid to be safe before this game.
“Of course we are not happy, but our goal was to stay in the Championship and Cardiff deserve to be in the Championship, so job done.
“We made it, we saved the club where at the beginning of the season there were 17 young players, and I’m the third manager.
“It is a massive achievement. I remember here three months ago I came and signed for this massive club, and said there is enough quality to stay in the Championship and we did it.”
- 5McGuinnessBooked at 68mins
- 23KipréSubstituted forRinomhotaat 74′minutes
- 2RomeoSubstituted forColwillat 74′minutes
- 19SawyersSubstituted forWickhamat 73′minutes
- 8RallsSubstituted forDaviesat 55′minutes
- 9EteteSubstituted forKabaat 14′minutes
- 10KoromaSubstituted forKasumuat 82′minutes
- 35DiarraSubstituted forHungboat 45′minutes
- 25WardSubstituted forRhodesat 65′minutes
- Michael Salisbury
Match ends, Cardiff City 1, Huddersfield Town 2.
Second Half ends, Cardiff City 1, Huddersfield Town 2.
Attempt missed. Rubin Colwill (Cardiff City) right footed shot from outside the box misses to the left. Assisted by Ryan Wintle following a set piece situation.
Connor Wickham (Cardiff City) wins a free kick on the left wing.
Foul by Matthew Pearson (Huddersfield Town).
Delay over. They are ready to continue.
Delay in match because of an injury Connor Wickham (Cardiff City).
Corner, Cardiff City. Conceded by Josh Ruffels.
Corner, Cardiff City. Conceded by Lee Nicholls.
Attempt saved. Rubin Colwill (Cardiff City) right footed shot from outside the box is saved in the top right corner. Assisted by Andy Rinomhota with a headed pass.
Attempt missed. Jaden Philogene (Cardiff City) left footed shot from outside the box misses to the right. Assisted by Andy Rinomhota.
Corner, Huddersfield Town. Conceded by Mark McGuinness.
Goal! Cardiff City 1, Huddersfield Town 2. Isaak Davies (Cardiff City) right footed shot from the centre of the box to the bottom right corner. Assisted by Jaden Philogene with a cross following a corner.
Corner, Cardiff City. Conceded by Tom Lees.
Substitution, Huddersfield Town. David Kasumu replaces Josh Koroma.
Attempt missed. Tom Lees (Huddersfield Town) header from very close range is close, but misses to the right. Assisted by Josh Koroma with a cross following a corner.
Corner, Huddersfield Town. Conceded by Jak Alnwick.
Corner, Huddersfield Town. Conceded by Sheyi Ojo.
Attempt blocked. Tom Lees (Huddersfield Town) header from the centre of the box is blocked. Assisted by Jack Rudoni with a cross.
Corner, Huddersfield Town. Conceded by Mark McGuinness.