Bristol City halted their four-match losing run in the Sky Bet Championship with a come-from-behind 3-2 victory against struggling Ipswich.
Freddie Sears had twice put Ipswich ahead but a Bartosz Bialkowski own goal and Jamie Paterson's strike brought the visitors level before Famara Diedhiou headed in a 64th-minute winner.
Sears had opened the scoring in the 32nd minute but the other four goals all came in a nine-minute period in the second half as Ipswich were left six points adrift of safety.
Ipswich came under pressure in the opening exchanges and a shot from Liam Walsh from just outside the penalty area was turned over the bar by Town goalkeeper Bialkowski.
Then Ipswich defender Jordan Spence failed to clear his lines in his own penalty area in the fifth minute and presented the ball to Paterson, who shot over the bar.
Three minutes later Town's Gwion Edwards charged down a clearance from the Robins defence and the ball fell to Sears, whose 25-yard shot from outside the penalty area went just past Finnish keeper Niki Maenpaa's right hand post.
In the 12th minute, after play was halted following a foul on the half way line, managers Paul Lambert and Lee Johnson were involved in a heated exchange that led to referee David Webb having a word with them.
Just after the half-hour mark Ipswich took the lead. A crossfield pass from Cole Skuse found Sears on the left wing, he cut inside towards goal and unleashed an unstoppable shot from inside the penalty area into the right corner of the goal.
The away side drew level in bizarre circumstances in the 55th minute when a cross from full-back Lloyd Kelly found Diedhiou inside the six-yard box and his shot was initially parried by Bialkowski but he then let the ball slip from his grasp and it ended up in the net.
Sears put the home side back ahead just three minutes later after an effort from Skuse fell to him just outside the penalty area and his firm shot beat Maenpaa.
However, within a matter of five minutes City were ahead.
First Paterson beat Bialkowski with a right-footed strike into the top corner of the net following a cross from Niclas Eliasson.
And Diedhiou – a half-time substitute – headed into the bottom left corner and ended his side's losing run.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Press Association Sport staff');
ga('pacontentapi.set', 'dimension2', 'bac7051b-6710-4fa6-a920-4c8b7b78b768');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:club-news,paservice:sport:football,paservice:sport:match-reports');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Famara Diedhiou header ends Bristol City\u2019s losing run'});