Bristol City's six-season spell in the Championship came to an end with a home defeat by Birmingham.
Needing victory to avoid the drop to League One, the Robins fell behind when Wade Elliott slotted into the bottom corner after Nathan Redmond's run.
The home side missed a good chance to level when Sam Baldock fired narrowly wide from 20 yards after Steve Davies's knockdown.
But Blues held on to send Bristol City down with three games remaining.
Sean O'Driscoll's appointment in mid-January had seen a significant upturn in results at Ashton Gate.
But poor away form and now back-to-back home defeats in the space of four days have proved their downfall.
Elliot scored the only goal of the game, slipping the ball past Tom Heaton in the 16th minute after a clever run and pass by Redmond, to move Birmingham up to 12th in the table.
The hosts were inches away from an equaliser in the 39th minute when Davies drilled the ball across the face of goal and the onrushing Baldock just failed to make contact at the far post.
The Championship's bottom club should then have levelled through Baldock but he decided to take his shot early and visiting keeper Jack Butland saved smartly.
Baldock spurned yet another good opening after 69 minutes when he connected well with Davies's knock-down but his 20-yard effort went wide.
And the game ended with Birmingham on top, Chris Burke beating Heaton with a low shot that Greg Cunningham cleared off the line.
Bristol City manager Sean O'Driscoll:
"That result and performance sums up the club's season. The players gave it everything in the second half, but couldn't take the chances.
"We needed promotion form when I took over and that is not easy with the same group of players when you are bottom of the table.
"There will be changes in the summer and we will do our best to provide a vibrant young team, who can take the club up again.
"It is no good having an academy if you are not ready to use the players it produces. The fans have stuck behind us brilliantly and we want to reward that."
Birmingham boss Lee Clark:
"We are not quite mathematically safe and it would be nice to take care of that with a good result in front of our own fans on Saturday against Leeds.
"We owe them a big performance because we have not been at our best in recent home games.
"Now I want a really big effort at St Andrews because there are a lot of positives to take from the second half of our season."