Jake Beesley's late goal ended Notts County's FA Cup run as Rochdale sealed a 2-1 victory in their first-round replay at Meadow Lane.
In another terrific encounter, the hosts had taken the lead when Josh Andrews thumped in a volley following a terrific cross as Ruben Rodrigues cracked the underside of the bar with a terrific effort from the edge of the box.
But the Magpies were deservedly level after the break when Aaron Nemane forced in at the back post following a superb cross from Adam Chicksen.
Notts continued to create chances but the second goal eluded them as Dale turned the screw in the final 10 minutes.
Anthony Patterson had to make a super save to deny Matty Done but he was eventually beaten in the final minute when Beesley's glancing header crept into the far corner.
And that was enough for the visitors to seal a home tie against League One Plymouth in the second round.
Key Events
Leigh CurtisHarsh on Notts that, but Beesley's goal has booked Dale's place in the second round.
KEY EVENTBeesley looks to have won it for Rochdale with a glancing header that creeps into the corner.
Leigh CurtisDone thinks he's scored with a header by Patterson produces a brilliant save.
Leigh Curtis4,460 (307 visitors)
Leigh CurtisChicksen finds Roberts whose cross is met on the volley by Rodrigues. It looks to be going in but Lynch saves.
Leigh CurtisThe ball comes into the box. It's cleared as far as Vincent but his shot is blocked.
Leigh CurtisRodrigues shows a perfect touch to draw a foul right on the byline. Free-kick in a great position. All about the delivery.
Leigh CurtisNemane turns in from Chicksen's cross. And we are level!
Leigh CurtisNotts just applying a bit of pressure now. Vincent's cross is headed clear and Notts have a throw.
Leigh CurtisRodrigues, now playing further up front, breaks and his shot is deflected for a corner.
Leigh CurtisNotts pressing with a bit more intensity and there's now a sub. Roberts is on for Mitchell in the 57th minute.
Leigh CurtisRodrigues has a go but clears the bar. Would have needed something very special to beat Lynch from there.
Leigh CurtisTaylor is upended and it's around 25 yards from goal. Think it's too far out to have a go myself given the angle.
Leigh CurtisFree-kick from Palmer is swung into the box for Wootton but he can't steer his header on target.
Leigh CurtisWe are back under way and Notts have made no changes. Neither have Rochdale.
Leigh CurtisNotts just need to find the accelerator here. Lots of midfield passes but they're not really going anywhere.
Leigh CurtisKelly plays a wonderful ball into the path of O'Keefe. Patterson comes rushing off his line. The full-back lobs the ball over his head but millimetres wide. Thought it was in.
Leigh CurtisBoth teams taking it in turns to have the ball. Rodrigues and Wootton have looked sharp for Notts.
Leigh CurtisNotts posing real problems for Dale at the back and Mitchell has just headed wide from Taylor's cross.
Leigh CurtisRodrigues rattles the woodwork with a terrific 25-yard drive.
Leigh CurtisNotts almost respond immediately as Aaron Nemane wriggles free in the box, but Lynch saves.
KEY EVENTAnd the visitors have the lead. Josh Andrews thumps a volley in at the back post. Terrific finish.
Leigh CurtisRochdale have a corner but Wootton clears.
Leigh CurtisVincent charges towards goal and tries to find Wootton but the pass is overcooked and Lynch collects.
Leigh CurtisIt's end to end already. Notts look a threat and Rochdale's high press is giving the Pies a few problems.
Leigh CurtisMatt Palmer lofts a ball over the top and it falls to Rodrigues but he shoots straight at Lynch.
Leigh CurtisPatterson fluffs a clearance and it falls straight to Beesley in the box, but Chicksen rescues the situation.
Leigh CurtisLeigh CurtisLeigh CurtisThree changes for Notts tonight.
Full story behind the team news is right here.