Mario Gomez scored and Germany won Group C at Euro 2016 by coasting to a 1-0 win over Northern Ireland on Tuesday.
Northern Ireland finished third with three points and secured their own place in the knockout stage once Turkey defeated Czech Republic 2-0 later in the day.
Germany largely overpowered their opponents, who were as concerned with limiting the damage as finding an equaliser. But the single goal was enough for Germany to finish ahead of Poland, who beat Ukraine 1-0 in the other Group C game to finish second.
Germany first threatened in the eighth minute as Mesut Ozil played in Thomas Muller with a single touch. But goalkeeper Michael McGovern rushed forward to stop his shot, leaving the striker still looking for his first goal of the tournament.
McGovern was called upon again four minutes later to save a Mario Gotze shot from eight yards, and Joshua Kimmich's chipped attempt from the rebound sailed off-target.
Northern Ireland had an opportunity when Jamie Ward nicked the ball from the feet of Gotze in midfield and rushed in toward goal, but Manuel Neuer easily gathered his shot from 25 yards.
Germany hit back immediately and Muller again came close when his low, diving header from Kimmich's cross crashed off the near post.
But a German goal always seemed to be on the cards and it arrived in the 30th minute when Ozil fed Gomez at the top of the box and the Besiktas man played through Muller, who drew McGovern out of position before passing back for Gomez to score.
Five minutes later, Gotze nearly doubled Germany's advantage, but his shot following a corner struck Conor Washington in the face on its way to goal.
It was more of the same in the second half as Muller's diagonal cross put Gotze in alone but McGovern again came to Northern Ireland's rescue, and a minute later Gotze redirected a low Ozil cross just wide of the post.
Joachim Low had seen enough and sent on Andre Schurrle to replace Gomez -- Germany's World Cup hero -- three minutes later.
Sami Khedira was the next to be denied by McGovern with a shot from distance on 59 minutes, with Gomez unable to react in time to head in the rebound.
As the second half progressed, Low replaced Khedira with Bastian Schweinsteiger and Jerome Boateng with Benedikt Howedes.
Gomez nearly had a second goal in the 82nd minute, but his header down was pushed aside by the outstretched McGovern, who made eight saves on the night and will be the hero if the result is enough for Northern Ireland to advance.
As Group C winners, Germany will next play Sunday in Lille against either Albania or Slovakia.
Northern Ireland will face either Wales or France, depending on the results of the final group-stage games on Wednesday.