Non-league Weymouth came close to causing a real shock at Gigg Lane as Bury edged through 4-3 in their FA Cup first-round replay.
Having held Chris Casper's team to a 2-2 draw earlier this month, Garry Hill's team fancied their chances of an upset.
They were on course for a place in the second round courtesy of goals from Simon Downer, Wayne Purser and Steve Tully.
But braces from Dwayne Mattis and on-song striker Andy Bishop made sure the League Two side booked a second-round showdown with Chester.
Weymouth were the better side in the first half although Mattis scored from the edge of the box to give Bury the lead in the 10th minute.
Downer (16) equalised with a 12-yard header for the visitors and then Purser (20) put Hill's team in front with a neat finish into the bottom corner only for Bishop (23) to bring the match all square again with an 18-yard volley.
Tully (30) made it 3-2 to Weymouth with a close-range effort as they led at half-time, but Mattis equalised in the 66th minute with a 20-yard effort and then Bishop scored the winner with a fine 25-yard strike 16 minutes from time to send Bury through.