EVEN Leicester City manager Nigel Pearson admitted his side were lucky to take all three points from this topsy-turvy showdown at a windswept Galpharm Stadium.
Lloyd Dyer’s scuffed shot 10 seconds into the three minutes added on by referee Andy Hall arched agonisingly over goalkeeper Matt Glennon and inches under the bar.
The winner, described by Pearson as "a good bad one" came during a spell of pressure following a harsh-looking free-kick given for Michael Flynn’s challenge on Dyer.
The former West Brom and MK Dons man hammered the set-piece straight into the Town wall, but then struck as Matty Fryatt teed him up.
Fryatt, a hat-trick scorer for Walsall against Town back in 2004-05, had scored himself in the 50th and 65th minutes.
The second came from the spot after West Midlands whistler Hall ruled Jim Goodwin had handled Dyer’s cross, a decision which Town boss Stan Ternent termed "quite incredible".
League I leaders Leicester looked set for a convincing victory, but Town dug deep to mount a spirited fightback.
Gary Roberts rifled home a 69th-minute shot (his fourth goal of the season) which took a deflection off on-loan Liverpool centre-back Jack Hobbs.
Then, in the 77th minute, Liam Dickinson headed home the third goal of his loan spell from Derby County to draw Town level.
That was the home side’s last real effort on goal, but they still deserved something from an entertaining match watched by a season-high 16,212 (2,490 from Leicester).
After all, they had become the first team to put two past the Foxes, who had conceded just three in eight games previously, and only one on their travels.
There was no doubting the quality in a Leicester team which included Bulgarian international centre-back Aleksander Tunchev and ex-England full-back Chris Powell as well as Arsenal defender Kerrea Gilbert and Liverpool pair Hobbs and goalkeeper David Martin.
Midfielders Nicky Adams and Andy King have just won Wales Under 21 call-ups into the bargain, but Ternent’s team still gave the visitors a test.
Leicester had three decent chances in the first half, with King dinking a shot across the face of goal, Fryatt fluffing a golden opportunity by firing straight at Glennon, who blocked with legs, then looking on as the stopper pushed away his flicked effort from Gilbert’s cross.
But Town, forced to reorganise after Ian Craney limped off with a sore hamstring in the 35th minute, also carved out several opportunities, the best falling to Flynn, who would surely have scored had he directed his header either side of Martin instead of straight at him.
Roberts fired one wide and another, from a free-kick, into the Leicester wall while Nathan Clarke couldn’t quite make contact with Craney’s nicely-weighted free-kick before Dickinson headed wide from a Phil Jevons cross.
Ternent will be perturbed by the fact that Town conceded early in the second half for a second successive game, Fryatt finishing cleanly after good approach work down the right by Adams in a move begun by a sloppy pass by Danny Cadamarteri.
Andy Butler saw one header punched away and another fly just wide before Fryatt sent Glennon the wrong way from the spot to double the lead.
But credit to Town for fighting back, with Martin blocking Roberts’ close-range shot with his right leg before being wrongfooted when the ex-Ipswich man’s drive hit Hobbs.
Rugged Steve Howard thought he had put Leicester 3-1 up in the 73rd minute when he shot home after Glennon parried King’s shot, only to be ruled offside.
And within four minutes Town were level when Dickinson headed Goodwin’s looping cross into the top left-hand corner.
But Leicester had the last word to stretch their lead to three points.