Nigerian winger Sammy Ameobi scored one of the finest goals of his career to claim the win that sends Bolton Wanderers out of the Championship drop zone.
Ameobi ran from inside his own half to fire in winner in the 71st minute.
The 25-year-old had begun by lifting the gloom with a fabulous run past three men and a viciously-swerving shot that flew inches wide in a bright start.
Bolton made openings of their own, with Walker nearly catching out Steele from a tight angle, but Bristol City had three chances in one attack and should have been in front.
The winger scored the only goal of the game to hand Trotters boss Phil Parkinson a major boost.