(Brentford won 4-3 on penalties)
Andy Frampton (left) celebrates his goal with Michael Turner
Alex Rhodes scored the decisive spot-kick as Brentford progressed to the FA Cup second round on penalties.
Brentford went ahead on the stroke of half-time through Andrew Frampton, who picked the ball up on the edge of the box before lashing home a low shot.
City rode their luck, but drew level after the break when Paul Heffernan converted Jamie Smith's cross.
Jay Tabb almost won it for the home side in extra-time, but it was left to substitute Rhodes to clinch victory.
Brentford: Nelson, O'Connor, Turner, Sodje, Frampton, Lawrence, Hargreaves, Talbot, Salako, Rankin (Rhodes 109), Harrold (Tabb 70).
Subs Not Used: Julian, Myers, Somner.
Booked: Hargreaves, Frampton, O'Connor.
Goals: Frampton 44.
Bristol City: Phillips, Smith, Hill (Coles 91), Butler,
Fortune, Murray (Brown 59), Doherty (Lita 59), Tinnion, Orr, Heffernan, Miller.
Subs Not Used: Gillespie, Harley.
Booked: Fortune, Phillips.
Goals: Heffernan 77.
Ref: A Hall (W Midlands).