WREXHAM finally got the better of Chesterfield in a game of two halves at The Racecourse.

The teams went head to head for a third time in the space of eight days with a place in the first round of the FA Cup the prize for the winners.

Dean Keates' side, beaten 1-0 in the league by the Spireites last week before Saturday's fourth qualifying round tie ended in a 1-1 draw to force a replay, were quick out of the blocks.

Wrexham were well on top, played some decent football and deservedly took the lead through JJ Hooper.

The Reds had easily been the better side in the first half but Chesterfield were in no mood to surrender.

Chesterfield came much more into the game and heaped the pressure on Wrexham in the second period.

Resolute defending kept the Spireites at bay but with Wrexham unable to get the crucial second goal to give them some breathing space, the game hung in the balance.

But one goal proved to be enough and Wrexham will now host League One side Rochdale in the first round.

Keates made four changes from the side that started Saturday's stalemate and he was without Shaun Pearson who picked up an injury at The Proact Stadium, so the Reds captain was replaced by Michael Chambers in the centre of defence.

Akil Wright, Devonte Redmond and JJ Hooper all impressed when Keates made a triple substitution and they came in for Luke Summerfield, Luke Young and Mark Harris, the players they took over from in Derbyshire.

Chesterfield's line-up showed six changes with ex-Wrexham trio Luke Coddington, Scott Boden and Anthony Spyrou handed their first starts of the three meetings between the sides.

Wrexham saw a lot of the ball in the early exchanges and were on the front foot with Bobby Grant firing wide in the sixth minute.

Grant made a good run from the halfway line and threaded a pass through to Hooper who won a corner as Wrexham continued their lively start.

From the resulting flag-kick, Jake Lawlor cleared the bar from close range after getting on the end of Wright's knock down as a superb chance went begging.

Chesterfield threatened for the first time when Spyrou got into the area and attempted to square the ball to Liam Mandeville but James Horsfield cleared the danger.

Wrexham were playing some good football and Paul Rutherford headed over from captain James Jennings' centre.

Boden's shot was saved by Rob Lainton at the other end but Wrexham went upfield and took a deserved lead in the 30th minute following a good move.

Rutherford fed Jennings who crossed from the by-line and Hooper flicked the ball into the net from inside the six-yard box.

Boden's header from Jay Sheridan's free-kick was saved by Lainton just before the break but Chesterfield had been second best.

The Spireites were fired up when the action resumed but Sheridan was unable to keep his effort down.

However, they continued to have the upper hand and Gevaro Nepomuceno's free-kick was turned behind by Lainton.

Chesterfield continued to pressure and Boden was put through on goal by Mandeville but Lainton made a smart block.

There was a respite and Coddington made a vital double save to keep Chesterfield in the game as the stopper denied Mark Harris before keeping out Rutherford's follow-up.

Back came Chesterfield and Mandeville's free-kick was headed narrowly wide by Boden.

Wrexham almost conceded what would have been an awful goal as Jennings' clearance hit Chambers but was saved on the line by Lainton.

Jennings made a block from Boden following a scramble and with Chesterfield continuing to press for an equaliser, Lainton made a stunning save to deny Jermaine McGlashan and Jennings blocked Boden's follow-up.

Grant had a chance to make the game safe when he was put through on goal but he was thwarted by Coddington.

Hayden Hollis headed inches wide in added time for Chesterfield but Wrexham managed to hold on and they progress in the cup.

Wrexham (4-1-2-1-2): Lainton; Horsfield, Lawlor, Chambers, Jennings; Barton; Redmond (Young 70), Wright (Summerfield 86); Rutherford; Grant, Hooper (Harris 67). Subs: Dibble, Tollitt, Oswell, Carrington.

Chesterfield (4-4-2): Coddington; Yarney (Wakefield 76), Gerrard, Hollis, Sheridan; Rowley (McGlashan 67), Smith, Mandeville, Nepomuceno; Spyrou (Denton 71), Boden. Subs: Buchanan, Evans, McKay, Fondop.

Attendance: 2,023 (71 from Chesterfield).