In one of the shocks of the season almost relegated York beat promotion chasing Portsmouth to keep alive their very slim chances of avoiding relegation from the Football League.
The Minstermen won for the first time in 13 games but are still nine points adrift of safety with nine available - and have a goal difference 11 inferior to third-bottom Newport.
Bradley Fewster headed York ahead, Lewis Alessandra hit a low shot and Luke Summerfield scored from 30 yards.
Gareth Evans got Portsmouth's goal after a mistake from Scott Flinders.
The defeat leaves Pompey in sixth place, five points clear of eight-placed Wycombe. They could secure a play-off place this weekend.
York, meanwhile, will be relegated if they do not beat second-placed Accrington on Saturday. They could also be relegated with a win if other results do not go their way. Dagenham and Redbridge have already been relegated.