Byron Moore scored a stoppage-time penalty as Crewe beat winless Bristol City in dramatic fashion.
The game looked set to end in a goalless draw before Moore was brought down on the edge of the penalty area by midfielder Scott Wagstaff.
The winger stepped up and sent City keeper Elliott Parish the wrong way.
Crewe missed a number of chances earlier in the game, with Moore hitting the crossbar and Oliver Turton's shot well saved by Parish.
City's best chance came when Jay Emmanuel-Thomas dispossessed Mark Ellis and was left one-on-one with keeper Steve Phillips, but he could only find the side netting.
The result left Sean O'Driscoll's side bottom of League One, while Crewe sit in 16th.
VIEWS FROM THE DRESSING ROOM
Bristol City head coach Sean O'Driscoll told BBC Radio Bristol:
"I didn't think either team deserved to win it and no team deserved to lose it so we would have been delighted with the draw.
"It would have been our first clean sheet and we were resolute at times.
"We probably had the best chance of the game in the first half. Jay went through and you would have bet on him going one-on-one with the goalkeeper he would have scored.
"We could have been talking about a really good defensive performance and a 1-0 win but were talking about a mistake at the death and going home with a loss."
Crewe Alexandra 01 Phillips 02 Tootle 03 Mellor 24 Molyneux (Clayton - 72' ) 05 Ellis 06 Dugdale 42 Grant 20 Turton Booked 26 Aneke (Ray - 95' ) 08 Osman 11 Moore Booked Substitutes 07 Clayton 10 Leitch-Smith 12 Ray 16 Guthrie 18 Nolan 19 Oliver 21 Garratt Bristol City 13 Parish 02 Moloney Booked 22 Shorey 21 Pack 03 Williams 05 Flint Booked 11 Wagstaff 14 Reid 09 Baldock (McLaughlin - 84' ) 10 Emmanuel-Thomas (Taylor - 60' ) 15 Bryan Substitutes 01 Fielding 16 Wynter 17 Cunningham 18 Taylor 23 Harewood 28 McLaughlin 30 Dunk
Ref: Geoff Eltringham