Nicky Maynard's goal nine minutes from time finally sealed Mansfield Town's passage into round two of the FA Cup after a nervy afternoon against National League part-timers Chorley.
It was a dour game with few chances for either side but swung on a passage of play on 80 minutes when keeper Conrad Logan denied the visitors what would probably have been a shock winner as he saved Lewis Baines' header.
Stags went straight up the other end and bagged the winner as Maynard headed home when Matt Urwin could only block a Jacob Mellis shot.
It was otherwise poor fare on a freezing afternoon with little for home fans to get excited about as Chorley kept their shape and Stags struggled to find penetration, despite so much possession.
The goal was one of only two home efforts on target all afternoon.
Mansfield made just one change with Leeds loanee Conor Shaughnessy not eligible to play and replaced in midfield by Will Tomlinson.
Top scorer Danny Rose returned from injury to take a place on the bench.
Chorley made two changes from last weekend; new signing striker Charles Vernam, on loan from Grimsby, going straight in, along with Adam Blakeman.
Chorley were first to threaten as Bishop's attempted clearance only reached Matt Challoner on the edge of the box and he rifled a shot over the top.
Then Smith's shot struck Preston on the back of the neck as the visitors continued on the front foot.
Maynard won Stags a free kick 20 yards out on 11 minutes only to see Otis Khan's kick strike the wall in the home side's first goal attempt.
On 16 minutes Stags lost the ball on the right and Massanka picked up the loose ball and saw his shot deflect wide for a corner.
There was more concern on 20 minutes as Ryan Sweeney gave away a central free kick 25 yards from goal and Blakeman curled it narrowly over with home hearts in mouths.
Alex MacDonald tried his luck from distance but was well wide as the home side continued to struggle to open up the part-timers.
Neal Bishop then made sure Logan was alert with a long back header that almost saw Vernam nip in, the ball having just enough on it to reach the keeper with home fans in a a panic.
A long period of home possession ended with Maynard heading over a Khan cross with home fans growing ever more restless with Stags' lack of penetration.
MacDonald was then just unable to take a killer through ball by Bishop in his stride and the moment was lost.
But Chorley came very close on 37 minutes as Massanka curled a low cross in front of goal that just evaded the incoming Vernam.
In reply, Gordon cut in from the right and fired over the far angle.
A minute later MacDonald played a one-two with Maynard but fired wide.
Cook suffered a cut eye as he went to head a left wing cross. He soon returned with the wound bandaged and shirt changed.
The industrious Khan had a low cross cut out by the keeper and soon after was too high with a shot from 20 yards as a few boos rang out as the home side left the field for the break.
Three minutes after the restart Logan had to punch an inswinging Smith corner away from almost on the goal line.
On 51 minutes' Stags' best move so far saw Kellan Gordon's backheel put MacDonald into the box where he cut past one opponent before flashing a low shot into the sidenetting.
Then Ross made a crucial tackle on Andy Cook as he tried to make room for a shot from Maynard's pass.
Maynard then had a shot blocked and Gordon saw a cross-cum-shot fizz just over the bar as Stags began to warm to their task at last.
We finally had a shot on target on 64 minutes as Khan set up Bishop for an effort that was turned away by Urwin.
With Chorley replacing both strikers, Stags sent on CJ Hamilton for MacDonald.
Then on 72 minutes Rose replaced Cook in the home attack and within seconds he sliced a chance from Khan's pull-back.
Rose then just failed to turn home a Mal Benning cross at the far post, but an offside flag was already up anyway.
With 12 minutes to go Mellis took over Tomlinson in the centre of midfield.
Chorley had not threatened all half but on 80 minutes brought a first and superb save out of Logan as he clawed away Baines' close range header from Carver's far post cross.
Within a minute Stags finally broke through at the other end.
Mellis shot low from outside the area and, as Urwin made the save, Maynard was close at hand to head the loose ball into the net.
The visitors threw everything at it at the end, winning corners and putting home fans' nerves through the wringer, the final whistle a huge relief with some boos still ringing out for John Dempster's men.
STAGS: Logan; Gordon, Pearce, Preston, Benning; MacDonald (Hamilton 64), Tomlinson (Mellis 78), Bishop, Khan; Cook (Rose 72), Maynard. Subs not used: Olejnik, Sterling-James, Knowles, Smith.
CHORLEY: Urwin, Challoner, Blakeman, Meppen-Walters, Ross (Newby 84), Cottrell, Smith, Baines, Nortey, Massanka (Carver 57), Vernam (Almond 62). Subs not used: O'Keefe, Newby, Dodds, Eccles.
REFEREE: Savvas Yianni of Weston-super-Mare.
CHAD STAGS MAN OF THE MATCH: Otis Khan.