Preston North End survived a late onslaught to edge out QPR 2-1 and snatch the last play-off spot from under the noses of Cardiff City.
Goals from Jon Parkin and Sean St Ledger made it four wins in succession for the Lilywhites and set-up play-off semi-final against Sheffield United.
But it went right down to the wire with Darren Carter clearing the ball off the line in the fourth minute of added time.
Preston thought they had gone ahead in the 13th minute when Jon Parkin, Billy Jones and Neil Mellor worked the ball from the right to the left and Chris Sedgwick side-footed it home only for the flag to go up for offside.
QPR keeper Radek Cerny made two saves from Sedgwick and a free-kick from Damien Delaney fell to Hogan Ephraim but he had an effort saved.
St Ledger had a left-foot shot saved before Preston opened the scoring.
A back pass was mis-read by Cerny and Parkin nipped in to round the keeper and then fired a shot low into the middle of the goal from a tight angle.
Simon Whaley had two efforts saved and then in the last minute of the first-half, Rowan Vine had a free-kick parried.
Ex-Preston striker Patrick Agyemang found himself with plenty of time in the area and drilled a low shot which Andy Lonergan saved with his legs.
But then in the 57th minute, Vine played a through ball to Agyemang and he beat Youl Mawene to slide the ball past the keeper to level the scores.
Cerny made a last-gasp tip to deny St Ledger and then he cleared a Paul McKenna cross.
But Preston made it 2-1 after 74 minutes when a Parkin long throw was flicked on by substitute Chris Brown and St Ledger headed home from inside the six-yard box.
Parkin and Brown had shots saved with Ephraim having a deflected effort saved and then, right at the end, Sedgwick had a cross saved before Carter cleared off the line from Matthew Connolly in stoppage time to the relief of a nervy Deepdale.