Swindon 3-2 Bristol City
Striker Nile Ranger netted a late winner as Swindon edged past struggling Bristol City.
Aden Flint's header against his former club put the visitors ahead before Swindon loanee Nicky Ajose drilled home an equaliser.
Jay Emmanuel-Thomas lashed in an impressive strike to restore City's lead, but Ajose levelled to make it 2-2 at the break.
The game was heading for a draw when Ranger rifled home to snatch the win.
City remain without a win in League One this season and were left frustrated after twice throwing away a lead.
Flint, who joined City in the summer for a reported £300,000, opened the scoring in an entertaining first-half with a header at the back post from Marlon Pack's corner.
Striker Ajose brought the hosts level with his first goal of his five-month loan spell with Town, driving home a low strike past keeper Frank Fielding.
The Swindon defence allowed in-form Emmanuel-Thomas to cut in off the right and lash the ball in for his seventh goal of the season.
But City's lead lasted only seven minutes before Ajose poked home his second from Massimo Luongo's centre to make it 2-2 at the break.
Dany N'Guessan had the ball in the back of the net for Swindon in a flat second half, but it was disallowed for a shirt pull in the build-up.
Ajose went close to grabbing his hat-trick but his simple effort was kept out by Fielding, while at the other end Sam Baldock failed to find the end of Joe Bryan's cross.
In the 87th minute, former Newcastle forward Ranger turned his defender and blasted it home to earn Mark Cooper's side all three points.
VIEWS FROM THE DRESSING ROOM
Swindon Town manager Mark Cooper told BBC Wiltshire:
"We had to win a different kind of game, a real battle, and we had to win a different kind of way which is very pleasing.
"I'm really pleased for the boys that came in. We suffered some injuries later on in the week which disrupted our preparation.
"We weren't at our best today, we played with our hearts rather than our heads.
"We let them know at half-time that the way we played wasn't acceptable."
Bristol City head coach Sean O'Driscoll told BBC Radio Bristol:
"It's been a frustrating season, not just for me but for everybody.
"But you spend your life in football being frustrated and disappointed and have rare moments of jubilation and success.
"The players have been really good and dusted themselves down from the game in midweek.
"They came out focused and full of confidence. We've created chances and people have got to find solace in that."