Preston Park witnessed plenty of stoppage time drama before Harefield United emerged victorious and very wet.
The Hares looked to have handed back two points when St Margaretsbury levelled two minutes into time added on but three minutes later Harefield deservedly snatched them back.
That kept United three points clear at the top on a day when the top five teams all won.
The Hares controlled the first half without creating too many chances although they did claim an early lead when Chris Drake rifled home in the 10th minute to cap great approach work.
The home defence was comfortable against most attacks as Harefield took the game to the visitors, who in turn played on the counter.
Midway through the first half a Craig Totton cross caused panic in the Saints defence which just managed to survive with the aid of some desperate defending and a scrambled clearance, and it was a similar story 15 minutes later as the Hares were not quite able to capitalise on their possession.
Rain, which developed into a torrent by the end of the game, brought added problems for the second period and Harefield again struggled to turn possession into chances.
Danny Buckle, back from a lengthy spell out injured, and Drake, plugged away but failed to add to the score, yet it did not seem to matter until just into injury time Saints broke out to catch Harefield flat-footed and John Barker netted to apparently earn the visitors a draw.
However, five minutes into stoppage time Paul Haynes rose to head home and snatch back the win with the last act of the game.
HAREFIELD: Miller, Williams, Lloyd, Kirk, Haynes, Williamson, Totton, Willis, Buckle, Brown, Drake. Subs: Kelly, Maleknia, Houliston, Eldridge.
Goals, Harefield: Drake 10; Haynes 90+5. Saints: Barker 90+2. Attendance: 84.
The reserves beat Leighton Town 4-0 in the Suburban League with goals from Denver Morris, Joe Newman, Lorenzo Scelci and Nathan Mottley, while the U18s saw off North Greenford United 5-1 in the Allied Counties League thanks to Jake Morton (2), Kemo Maphata, Jack Reader, Sam Cooke.