Michael Smith curled home a 78th-minute winner as Swindon Town beat 10-man Bristol City 1-0 to end the League One leaders' 16-game unbeaten streak this season.
Wade Elliott's early red forced the visitors into defending for large spells, but Smith broke their stubborn resistance with 12 minutes remaining to send the hosts second in the table, four points adrift of Bristol.
Steve Cotterill's side came into the game with an impressive unbeaten record to protect, but Elliott jeopardised that streak after being sent off within just three minutes for an off-the-ball incident with Jack Stephens.
The hosts toiled for much of the half but struggled to make their numerical advantage count, with Michael Smith heading narrowly over from a Nathan Thompson corner on 27 minutes.
Town grew stronger as the half went on, and Stephens surged forward from midfield but dragged his effort just wide of Frank Fielding's goal at the 30-minute point.
Mark Cooper's side retained that momentum after the break and threatened to move ahead when Harry Toffolo saw his strike cannon off the crossbar early in the second half.
Bristol showed why they boast the second-best defence in the division, with Aden Flint denying Smith a certain goal by producing a last-ditch intervention.
Town continued to throw the kitchen sink at their local rivals but a combination of good luck and good goalkeeping kept 10-man Bristol alive.
First, Nathan Byrne pinged a 25-yard volley off the underside of the crossbar, before Fielding pulled off a fine save to tip away Stephens's long-range shot.
The 26-year-old stopper was finally beaten on 78 minutes, as Smith danced his way into the area before finding the bottom left-hand corner for what was his 12th goal of the season.
Cotterill's men came within inches of preserving their undefeated run and snatching a point when Aaron Wilbraham fired over the bar from a good position in the dying stages.