Leif Davis scored in the 89th minute as Ipswich Town dramatically kept themselves in the Championship’s automatic promotion places as they twice came from a goal down to beat Bristol City 3-2.

Town’s Conor Chaplin hit the post after a 32nd-minute corner was flicked on in a goalless first period before Anis Mehmeti’s deflected effort put City ahead early in the second half.

Nakhi Wells hit the frame of the Ipswich goal soon after, Ahmed Al Hamadi then made it 1-1 before Tommy Conway headed City back in front.

But Chaplin headed Town level again before Max O’Leary easily saved Al Hamadi’s poor penalty with five minutes to go, only for Davis to win it a couple of minutes later.

Jack Taylor hit the post in the fifth minute of stoppage time as Ipswich almost got a fourth.

The win sees Town stay two points clear of third-placed Leeds having won 28 points from losing positions this season, while City remain in 13th place.