Derby County moved back into the automatic promotion places but Luton Town's brief spell in the Championship ended when they were beaten at Pride Park.
A first-half goal from Lewin Nyatanga on his first appearance for Derby since September was enough to secure three vital points and condemn Luton to League One.
But the visitors put up a spirited fight and, although Derby had the better chances, the result was in doubt right up until the end.
Both teams needed to win for contrasting reasons and it was Derby who looked the more likely to score with skipper Matty Oakley striking the crossbar with a 25-yard free-kick in the 14th minute.
But Luton showed they should not be underestimated when Matthew Spring put David Bell in on the Derby right and his low cross was cleared by Nyatanga at full-stretch.
But Derby were starting to ask questions of the Luton defence and it needed a goalline clearance from Chris Coyne to deny his former team-mate Steven Howard in the 29th minute.
The pressure finally told when Derby forced another corner in the 37th minute and David Jones whipped the ball across for Dean Leacock to connect with a diving header that was brilliantly saved by Dean Brill before the ball fell to Nyatanga who bundled it over the line from close range.
If Derby expected that to open up the floodgates they were disappointed, although it was the home side who created the better chances in the second half.
Another Jones free-kick saw Leacock head against the bar and then Howard was denied by another outstanding save from Brill.
But the 28,000-plus Derby supporters had some anxious moments ahead of them as Luton were forced to throw more men forward in search of the win that would have preserved their status for at least one more week.
Drew Talbot just failed to connect with a low cross and the nerves were starting to show as Derby began to waste possession.
They had a chance to settle themselves when Oakley robbed Spring in the 71st minute and sent Arturo Lupoli in on the left, but once again Brill produced another outstanding save.
The introduction of Besian Idrizaj finally gave Luton a cutting edge and he almost found an equaliser nine minutes from time when he cut in from the left and fired in a low shot which Stephen Bywater did well to keep out.
Luton kept going but it was Derby who almost scored again when Brill denied Lupoli in stoppage time.