David Flitcroft recorded his first victory in charge of Bury as his side hung on for a 2-1 home win against fellow strugglers York to climb out of the League Two drop zone.
The Shakers were 2-0 up inside 19 minutes through Anton Forrester and Nathan Cameron and, although York substitute Michael Coulson pulled one back, the hosts claimed their first win in four attempts under Flitcroft to leapfrog York in the table.
Bury made a superb start as a fine passing move released Danny Nardiello on the right and he squared for Forrester to side-foot home after just 38 seconds.
York could have equalised less than a minute later as Josh Carson volleyed wide from a good position.
But Bury doubled their lead as Chris Sedgwick crossed from the right and Nardiello's header was spilled by goalkeeper Aaron McCarey, allowing defender Cameron to force the ball in.
Nardiello and team-mate Danny Mayor then fired wide from inside the penalty area while Lanre Oyebanjo twice went close for the visitors, who made a double substitution at the break.
Bury keeper Brian Jensen prevented Coulson from getting York back into the game while Forrester twice went close to sealing victory.
Coulson was not to be denied, though, and in the 73rd minute he tapped home from close range after Ryan Jarvis' shot was blocked.
Shakers substitute Shaun Harrad went closest to scoring late on as York failed to avoid their first defeat in six following five successive draws.