Collin Quaner's last-gasp strike earned 10-man Ipswich a morale-boosting 3-2 win over Leeds, who head into the play-offs in dire form.
Marcelo Bielsa's side go into the first game of a two-legged tie with Derby having thrown away automatic promotion after successive defeats to Wigan and Brentford were followed by a draw against Aston Villa and the latest setback in Suffolk.
It was only a fifth win of the season for the relegated Tractor Boys, with Flynn Downes and Andre Dozzell their other scorers.
Leeds had levelled twice through Mateusz Klich and Stuart Dallas, while Kemar Roofe missed a penalty which had been awarded following a professional foul on him by Luke Chambers, who was sent off.
Championship play-off schedule
|Saturday 11 May||12.30pm||1st Leg||Aston Villa vs West Brom|
|Saturday 11 May||5.15pm||1st Leg||Derby vs Leeds|
|Tuesday 14 May||8pm||2nd Leg||West Brom vs Aston Villa|
|Wednesday 15 May||7.45pm||2nd Leg||Leeds vs Derby|
Town midfielder Downes found himself with just goalkeeper Kiko Casilla to beat in the 19th minute following tidy link-up play with Quaner and Alan Judge, but his goal-bound effort was deflected for a corner.
In the 28th minute, Ipswich striker Quaner collected a slide-rule pass from Dozzell only to be fouled outside the area by Casilla. But from the resulting free-kick by Judge the home side took the lead through Downes after the ball fell to him in the six-yard box.
Just before half-time, Klich equalised for the visitors when he slammed the ball past Bartosz Bialkowski at the near post after a pinpoint cross from full-back Luke Ayling.
However, Ipswich regained the lead with a superb strike two minutes into the second half. Neat one-two touches in midfield between Trevoh Chalobah and Quaner fed Dozzell and he fired home from just inside the penalty area.
Bialkowski got down quickly to save a shot from Pablo Hernandez on the hour and defender Pontus Jansson headed narrowly wide in the 69th minute following a corner as Leeds fought for an equaliser.
A great double save from the Ipswich goalkeeper from attempts by Klich and Hernandez kept the visitors at bay.
But they did draw level after 76 minutes following another fine cross by Ayling. He found Roofe whose shot hit the crossbar and bounced down, struck Dallas and the ball ended up in the net.
Leeds were then awarded a penalty in the 80th minute when Chambers was adjudged to have fouled Roofe.
The Ipswich captain was shown a straight red card as Roofe prepared to take the penalty but he fired high over the crossbar, much to the delight of the Ipswich fans.
Ipswich then won the game in bizarre fashion following a mix-up between Ayling and Casilla, with Quaner pouncing to fire the ball into an empty net.
Paul Lambert: "It was a brilliant win, a fantastic win, but I think that's what we have deserved with all the draws we've had and if we'd won another six, I don't think anyone would have begrudged it because we played that well.
"It's only the last three games or so that the wind was taken out of our sails. I can't ask for anything more.
"Leeds United are a very good side and not many teams have beaten them. We got the breaks at the right moments.
"We deserved them but we played some good, energetic football and I think we matched them for a lot of the game and we always looked dangerous."
Marcelo Bielsa: "If you put aside the mistakes we made from this game, the performance from the team was good enough.
"At the end of the game you could not think that this opponent (Ipswich) could score three goals against us and it was impossible that we could not score three or four goals.
"We conceded three goals and this is something that is honestly impossible to explain and we also only scored two goals, which is also difficult to justify."