Harrogate dropped out of the National League play-off places following a last-gasp home defeat by Ebbsfleet.
Michael Cheek put the visitors into the lead after eight minutes when he headed in Andy Drury's inswinging corner at the far post.
There was an unlikely early substitution in the first half, as referee Chris Pollard suffered what appeared to be a knee injury and was forced from the pitch after just 13 minutes.
Jack Muldoon fired an equaliser for Town five minutes after the restart when he finished off a fine counter attack following great work from Josh Falkingham and Ryan Fallowfield, which looked to have earned a point for the hosts.
However, Ebbsfleet won it with two minutes remaining as Drury tapped in from close range after Josh Payne's free-kick was headed back across the six-yard box to steal all three points for the Kent outfit.
Match report supplied by the Press Association.