Bolton moved into the Championship's play-off places after substitute Craig Davies's late penalty earned a win at all-but-relegated Bristol City.
Wanderers went ahead inside two minutes after Liam Fontaine turned Darren Pratley's cross into his own net.
But Bolton were pegged back after the break when Albert Adomah's cross was nodded home by Steven Davies.
The points were settled when, after Matthew Bates brought down David Ngog, Craig Davies converted from the spot.
The result means Bristol City are 10 points adrift with four games remaining while Bolton move up to sixth on goal-difference ahead of Nottingham Forest.
The hosts came into the game knowing victory was imperative in their attempts to avoid relegation, but they made a calamitous start when Fontaine inadvertently put the ball into his own net after only 84 seconds.
City responded positively though and Liam Kelly almost embarrassed visiting goalkeeper Adam Bogdan with a sliced cross which looped narrowly wide before Stephen Pearson blazed over when given space inside the Bolton penalty area.
Adomah spurned a further opportunity to get the hosts back on level terms before Bogdan was called into action, doing well to divert Davies's effort to safety after the former Derby striker had tried to slide the ball under the keeper.
Pratley tested Tom Heaton with a long-range effort which need parrying over the bar soon after the interval before the Robins found the equaliser they deserved.
Adomah delivered a pinpoint cross from the bye-line to Davies who made no mistake with a simple downward header, his 13th goal in only 18 starts.
The visitors then had a penalty shout turned down when Zat Knight's header appeared to strike Bates's arm.
But, having been reprieved only six minutes earlier, Bates brought down Ngog inside the area.
Davies smashed the penalty down the middle into the roof of the net to seal a crucial victory for Bolton while all but consigning City to the third tier of English football.
Bolton boss Dougie Freedman:
"You need different tools to be a successful side and today we showed our battling qualities. The race for play-off places is wide open and I see no reason why Bolton Wanderers should not be in the top six come the end of the season.
"We met a Bristol City side fighting for their lives and working very hard for each other. It was never going to be easy.
"But when other people were opening presents on Christmas Day we were training. Now we are reaping the reward of months of hard work."
Bristol City manager Sean O'Driscoll:
"Our performance had everything I would want apart from enough goals to win the game.
"I was disappointed we didn't get a penalty for handball late in the game, but that's the way things have been going for us.
"We have a big summer ahead with a number of contracts up, but I can't ask more in terms of effort than the players showed today.
"The fans have stuck with us, but we have known for a while that a change of strategy was necessary at the club.
"We can't keep on throwing millions of pounds at trying to achieve success. It hasn't worked."