LUKE BECKETT slotted a sweet last-gasp winner as battling Town avenged their FA Cup defeat at Accrington of four years ago.

But it took two moments of class from teammate Malvin Kamara to provide an escape route from yet another first-round knockout.

When Stanley skipper Peter Cavanagh fired home a 12th-minute free-kick, then Paul Mullin tapped home from close range 13 minutes later, it looked as though Town were heading for sixth straight early exit in all competitions.

But Andy Ritchie’s side, who hardly deserved to be two down, held their nerve and hit back.

Kamara’s initial effort, in the first of three minutes of added time at the end of the opening half, was a crucial blow.

The frustration on the face of Accrington manager John Coleman, and the relief on Ritchie’s, was plain to see.

There was still work to be done though, and stubborn Stanley held out until seven minutes from time, and will claim they deserved at least a replay.

Town had bossed the second half, however, and after Kamara cracked home his second, they had the momentum.

In that first-round tie of 2003, Accrington’s Andy Gouck fired home a stoppage-time strike.

This time it was the Town fans – who must have made up at least half a disappointing 2,202 crowd – who were celebrating a late clincher.

The opening stages of a tie played in wind and rain had suggested a more straightforward afternoon was in store for the visitors.

With Danny Cadamarteri lively, they controlled the early stages, and Andy Booth and Kamara both brought saves from former Halifax goalkeeper Ian Dunbavin with brave headers.

But a free-kick on the edge of the area conceded by Andy Holdsworth for a foul on David Brown gave long-serving right-back Cavanagh the opportunity to show his set-piece prowess.

His shot was both accurate and well struck, with the ball nestling in Matt Glennon’s right-hand stanchion.

Town’s stopper pulled off a fine save to deny Roscoe Dsane when he was through one-on-one in the 24th minute.

But he was retrieving the ball from the back of the net again less than 60 seconds later.

Centre-back Nathan Clarke’s fresh-air kick allowed Dsane to romp through unhindered for a second time, and rather than go for glory himself, he unselfishly squared the ball for Mullin to tap home his eighth goal of the season.

It was looking bleak for Town, but they refused to buckle.

Cadamarteri had Dunbavin stretching to paw away an awkward cross-cum-shot, while a mazy 37th-minute run by Kamara set up Danny Schofield for an effort which was parried, then cleared.

Cadamarteri and Stanley’s James Harris both put drives from distance wide before Kamara counted.

Clarke’s long throw was cleared by Mullin, but David Mirfin returned the ball and Kamara, lurking on the edge of the penalty area, neatly turned his marker Mark Roberts and netted with a low shot.

Accrington had a couple of decent efforts soon after the restart, with Cavanagh sending another free-kick across the face of goal and Glennon touching Dsane’s angled drive around his right-hand post.

But Town, now playing with the wind at their backs, gradually got back on top, and Booth and Ronnie Wallwork both tried their luck with long rangers before Clarke brought a smart reaction save from Dunbavin with a close-range shot from Holdsworth’s corner.

After Booth had a 65th-minute header held, Ritchie upped the ante by bringing on striker Beckett for defender Joe Skarz.

Booth’s header was pushed away for a corner, then Beckett nodded just off target, but sighs of relief from the Stanley fans turned to groans as Kamara netted on the half-volley after Clarke’s long throw was cleared, but only to the edge of the area.

Dunbavin saved from Frank Sinclair after the Town captain played a nice one-two with Cadamarteri, but there was no denying Beckett, who fired his fifth goal of the season after Holdsworth’s surging run and pass.