Match ends, Yeovil Town 1, Huddersfield Town 2.
Yeovil Town 1-2 Huddersfield Town
Huddersfield midfielder Adam Clayton's injury-time winner pushed bottom club Yeovil to the verge of relegation from the Championship.
The Terriers led when Nahki Wells slid in at the far post - his seventh goal since arriving from Bradford in January - after a driving run by Adam Hammill.
Town's lead lasted less than four minutes as Tom Lawrence equalised for Yeovil with a thunderous low free-kick.
But Clayton rifled in to leave Yeovil six points adrift with two games left.
The results leaves the Glovers rooted to the bottom of the table while Huddersfield have guaranteed their position in the Championship.
Yeovil now require an improbable set of results and a considerable swing in goal difference to extend their one-year stay in the second tier, the highest level they have ever played at.
The hosts came close to notching an opener inside three minutes when James Hayter headed Kevin Dawson's drilled cross over the bar.
Huddersfield, who made the 250-mile trip south without a win in their last 10 league matches, started slowly and should have conceded moments later when Hayter's header beat Alex Smithies but rattled the crossbar.
Welsh winger Lawrence looked the most likely to break the deadlock for the Glovers and he forced Smithies into a good save when his fizzing free-kick appeared to be spiralling towards the top corner.
Moments later the 20-year-old spurned a glorious opportunity as he galloped through on goal following a defensive mix-up between Anthony Gerrard and Murray Wallace. However, his decision to try to take the ball around Smithies backfired as the giant keeper got down quickly and plucked the ball from the youngster's feet.
Yeovil, who also came into the match short of form with only one win in their last 10 matches, continued to labour in front of goal and were left cursing referee Stuart Attwell shortly before the hour mark when Lawrence appeared to be tripped inside the box, but his claims were waved away.
The visitors snatched the lead following a swift 69th-minute counter attack when Hammill darted down the right flank from inside his own half before superbly guiding the ball to the back post for Wells to bundle home from close range.
But three minutes later Yeovil's survival hopes were resurrected when Lawrence's fierce free-kick dissected the Huddersfield wall and flew past Smithies.
Gary Johnson's side pushed for a late winner in eight minutes of added time, but midfielder Clayton stunned Huish Park by drilling a late decider with seconds remaining to leave Yeovil's relegation to League One all but mathematically confirmed.
Yeovil manager Gary Johnson: "We knew we were in a division that we had to enjoy and we have done that. Our supporters have enjoyed the Championship and we're definitely competing above our status.
"Hopefully being back in League One we can regroup and challenge to get back into this league.
"We need to become bigger as a club, have better infrastructure, better stadium and a bigger budget if we're going to be anywhere near keeping a team in the Championship. Our attendance today was around 5,000 - if you're in the Championship you can't survive on that.
"We owe it to the other teams in this division to keep giving our best and make sure we try to pick up points in our last two games."
Huddersfield manager Mark Robins: "That was tough to watch and this Championship can do all sorts to you. We've got competent players but they looked less than competent in the first half and kept giving the ball away.
"The Easter period is always tough with the quick turnaround in games. The same players are used and it becomes a real slog. I'm just grateful we could see it out and Adam's winner was outstanding.
"There's a big relief out there because we needed the three points desperately today. I'm still disappointed we're talking like that and this season has to be a lesson. It's not going to the very last game this season so that's progress, but I'd like a long summer of hard work to try and improve us for next season.
"My thoughts can now turn to the summer because we've secured our status."
- 8PalazuelosSubstituted forFoleyat 80'minutes
- 7DawsonSubstituted forLanzoniat 68'minutes
- 19RallsSubstituted forGrantat 68'minutes
- 39GerrardBooked at 17mins
- 15WallaceBooked at 65mins
- 4NorwoodSubstituted forHolmesat 67'minutes
- 11WardSubstituted forScannellat 50'minutes
- Stuart Attwell
- Shots on Target
Second Half ends, Yeovil Town 1, Huddersfield Town 2.
Goal! Yeovil Town 1, Huddersfield Town 2. Adam Clayton (Huddersfield Town) right footed shot from the centre of the box to the high centre of the goal.
Attempt missed. James Hayter (Yeovil Town) header from the centre of the box misses to the left. Assisted by Tom Lawrence with a cross following a corner.
Corner, Yeovil Town. Conceded by Nahki Wells.
Offside, Yeovil Town. James Hayter tries a through ball, but Byron Webster is caught offside.
Foul by Duane Holmes (Huddersfield Town).
Joe Edwards (Yeovil Town) wins a free kick in the defensive half.
Corner, Huddersfield Town. Conceded by Matteo Lanzoni.
Attempt blocked. Sean Scannell (Huddersfield Town) right footed shot from the centre of the box is blocked. Assisted by Adam Clayton.
Corner, Huddersfield Town. Conceded by Shane Duffy.
Foul by Sean Scannell (Huddersfield Town).
Matteo Lanzoni (Yeovil Town) wins a free kick in the defensive half.
Attempt missed. Murray Wallace (Huddersfield Town) header from the centre of the box misses to the left. Assisted by Adam Hammill with a cross following a corner.
Delay over. They are ready to continue.
Delay in match Anthony Gerrard (Huddersfield Town) because of an injury.
Corner, Huddersfield Town. Conceded by Sam Foley.
Attempt saved. Shane Duffy (Yeovil Town) header from the centre of the box is saved in the top centre of the goal. Assisted by Luke Ayling.
Foul by Adam Clayton (Huddersfield Town).
Luke Ayling (Yeovil Town) wins a free kick on the right wing.
Attempt saved. Sean Scannell (Huddersfield Town) right footed shot from outside the box is saved in the bottom left corner.
Attempt blocked. Adam Hammill (Huddersfield Town) right footed shot from the centre of the box is blocked. Assisted by Adam Clayton.
Corner, Huddersfield Town. Conceded by Jamie McAllister.
Substitution, Yeovil Town. Sam Foley replaces Ruben Palazuelos.
Corner, Huddersfield Town. Conceded by Shane Duffy.
Offside, Huddersfield Town. Sean Scannell tries a through ball, but Nahki Wells is caught offside.
Corner, Huddersfield Town. Conceded by James Hayter.
Corner, Huddersfield Town. Conceded by Luke Ayling.
Attempt blocked. Adam Clayton (Huddersfield Town) left footed shot from the left side of the box is blocked.
Corner, Huddersfield Town. Conceded by Marek Stech.
Attempt saved. Adam Hammill (Huddersfield Town) right footed shot from outside the box is saved in the bottom right corner. Assisted by Duane Holmes.
Goal! Yeovil Town 1, Huddersfield Town 1. Tom Lawrence (Yeovil Town) from a free kick with a right footed shot to the bottom left corner.
Foul by Murray Wallace (Huddersfield Town).
James Hayter (Yeovil Town) wins a free kick in the attacking half.
Goal! Yeovil Town 0, Huddersfield Town 1. Nahki Wells (Huddersfield Town) right footed shot from the left side of the six yard box to the high centre of the goal. Assisted by Adam Hammill.
Substitution, Yeovil Town. Joel Grant replaces Joe Ralls.
Substitution, Yeovil Town. Matteo Lanzoni replaces Kevin Dawson.
Foul by Nahki Wells (Huddersfield Town).
Luke Ayling (Yeovil Town) wins a free kick in the defensive half.
Substitution, Huddersfield Town. Duane Holmes replaces Oliver Norwood.