Goalkeeper Cameron Belford was the penalty hero as Bury knocked out Shrewsbury to reach the northern area quarter-final of the Johnstone's Paint Trophy.
The second-round tie at Gigg Lane finished in a 0-0 stalemate after 90 minutes, sending the match into a penalty shoot-out.
Each side converted their first five penalties to go into sudden death and Belford saved Daniel O'Donnell's spot-kick before firing home himself to seal a 6-5 shoot-out win.
Bury had the better of the first half with Kyle Bennett and Peter Sweeney firing narrowly wide early on. O'Donnell then had a goal disallowed for Shrewsbury before Bury's Lenell John-Lewis saw a shot come back off the inside of a post.
On-loan Manchester United forward Nicky Ajose was looking dangerous for Bury, although Matt Harrold headed over for the visitors just before the break. Lewis Neal then tested Belford at his near post, while John-Lewis sliced a shot well wide from Bennett's through-ball.
Tom Bradshaw had a late effort blocked by Bury centre-half Ben Futcher before missing the best chance of the game, poking wide from Sean McAllister's long ball. Belford's penalty heroics then sent the home side through.