League Two leaders Crawley Town moved into the fourth round of the FA Cup after Matt Tubbs hit a late winner to dump Bristol City out.
Crawley were on top throughout and hit the woodwork twice in the first half.
They took the lead when Tubbs raced onto a long ball over the top, and kept his cool to slot the ball past former England goalkeeper David James.
City were then reduced to 10 men late on when Stephen Pearson was shown a second yellow card.
As a non-league side, Crawley beat Derby on their way to a fifth-round defeat by Manchester United in the competition last season, and they dominated from the off.
Tyrone Barnett headed wide inside the opening two minutes and Josh Simpson and Tubbs both went on to hit the post in the first half.
Simpson came close when his shot from the edge of the box beat James in the City goal but hit the inside of the post and bounced to safety.
Crawley defender Claude Davis then fired an ambitious first-time volley over the bar before Nicky Maynard wasted the best chance for the visitors when he shot wide from Albert Adomah's pass.
Tubbs - who netted 40 times during Crawley's promotion season last term - then smashed a low shot against the post and Dannie Bulman failed to force in the rebound.
The hosts were well on top and deservedly took the lead when Sergio Torres's pass split the visiting defence and Tubbs slotted the ball into the bottom-right corner.
Any hope of a Bristol City comeback ended late on when Pearson received a second yellow for a poor challenge on Simpson.
Crawley boss Steve Evans told BBC Sussex:
"We did our homework and got our tactics right. It was about keeping our discipline and our shape in the second half.
"We were by far the better side. We had a lot of effort and passion all over the pitch.
"This is a fantastic result for us. It's been a good day but we won't get too high."
Bristol City manager Derek McInnes told BBC Radio Bristol:
"There was no surprises from Crawley. We knew what we were going to face.
"I felt we competed well enough but we never showed the quality we were looking for.
"We should have shown more courage and more ability on the ball."