Robert Lewandowski ended the Republic of Ireland's hopes of automatic qualification for the Euro 2016 finals as Poland secured their trip to France.
The Bayern Munich striker's 15th goal in 447 minutes of football for club and country handed the home side a 2-1 win to end their Group D campaign in second place behind world champions Germany. Grzegorz Krychowiak had given the Poles a 13th-minute lead at the Narodowy Stadium, but Jonathan Walters' penalty three minutes later gave Ireland, who had skipper John O'Shea sent off for as second bookable offense in injury time, fresh hope until Lewandowski's 42nd-minute intervention.
Martin O'Neill's men, who had won their three previous qualifiers to keep themselves firmly in the race, have the consolation prize of a place in the play-offs, but still have plenty of work to do if they are to join England, Wales and Northern Ireland at next summer's finals.
O'Neill, who had hinted in the run-up to the game that some of his players were feeling the effects of their exertions against the Germans, made five changes, restoring Glenn Whelan and James McClean after suspension, drafting in Seamus Coleman following his recovery from a hamstring problem and rewarding keeper Darren Randolph and match-winner Shane Long for their efforts on Thursday evening.
The game rather meandered through the early stages as the teams probed away at each other without ever really threatening to do anything decisive, and there was no real indication of what was to follow. However, it exploded into life with 13 minutes gone when, after Coleman and O'Shea has combined to repel a foray into the box, the ball fell to Kamil Grosicki, who prompted a good reaction save from Randolph from close range.
Ireland managed only to half-clear the resulting corner to Krychowiak 20 yards out and his sweetly struck low drive sped into the bottom corner with the wrong-footed Randolph helpless. But the visitors were behind for only three minutes, although the incident which led to the equalizer did not go down well with the home fans among a crowd of 57,497.
Defender Michal Pazdan's high challenge on Long was ugly, but television replays suggested it might have occurred outside the box. Turkish referee Cuneyt Cakir nevertheless pointed to the spot and Walters calmly beat keeper Lukasz Fabianski to claim his eight goal in an Ireland shirt.
The Poles saw an 18th-minute Pawel Olkowski strike correctly ruled out for offside as the home side redoubled their efforts, and although the Republic defended stubbornly, they eventually succumbed three minutes before the break. This time, Olkowski was the provider, picking out Lewandowski with the perfect cross for the in-form striker to power a header past Randolph.
Adam Nawalka's men returned determined to kill the game off and assure their presence in France as quickly as possible, and Ireland found themselves largely on the back foot once again. Whelan forced Fabianski into a solid save with a 51st-minute shot from distance after Robbie Brady's enterprising run, but the Stoke midfielder was to depart seven minutes later when he was replaced by Aiden McGeady, and he did so having seen Long carried from the field on a stretcher with what looked like an ankle injury.
Long's departure had prompted Robbie Keane's introduction, but although Ireland were now contesting the game higher up the pitch, that left space behind and Grosicki almost exploited it when he was played in with 65 minutes gone, only for Randolph to block. Randolph might have been called upon once again six minutes later after Lewandowski raced clear of the cover, but Coleman came to his rescue with a superbly-timed challenge.
Central defender Richard Keogh came close nine minutes from time when he got his head to McGeady's cross, but Fabianski claimed the ball at the second attempt, and Ireland's hopes were gone when O'Shea, who had been cautioned before the break, felled Lewandowski and was dismissed.