Northern Ireland lost at home in Windsor Park for the first time in four years as Germany booked their place World Cup Russia 2018 – where they will defend their crown.

Michael O'Neill's men last lost a qualifier in Belfast to Portugal in September 2013 when Cristiano Ronaldo scored a hat-trick and, while they were undone by arguably the world's best player that night, they were beaten 3-1 here by perhaps the planet's finest international team.

Sebastian Rudy's sweetly-struck effort from range 83 seconds in ended Michael McGovern's 10-hour run without conceding an international goal, and it was game over when Sandro Wagner rolled Gareth McAuley and fired home after 21 minutes.

The tremendous Joshua Kimmich fizzed in a back-post volley four minutes from time before Josh Magennis claimed a consolation for the hosts in stoppage-time.

It continued the Germans' phenomenal record of having never lost an away World Cup qualifier, while maintaining their 100 per record in Group C, with Northern Ireland's focus on second place ever since they were drawn against Joachim Low's side.

The runners-up berth has already been sewn up ahead of their final qualifier in Norway on Sunday, and they could be assured of a play-off place before that if results on Saturday night go their way.

Crucially for O'Neill, neither their goal difference or perilous disciplinary situation were impacted too much - and they remain very much on course for a two-legged tie in November that will determine if they will join Germany in Russia.

After being given the run-around by the Germans three times over the past 16 months, they will hope the draw is kind.

Josh Magennis celebrates scoring a late goal

McGovern's long run without conceding dated back a year, yet it was ended inside two minutes, and in some fashion.

As was the case with so many German attacks in the first period, it originated down the right. Leon Goretzka's cross was volleyed out by Lee Hodson to Kimmich and he teed up his Bayern team-mate Rudy to unleash a 30-yard bullet into the top corner.

Shortly after Thomas Muller rolled the pass into Wagner and he took a touch to open his body up and turn away from McAuley before ruthlessly rifling a left-footed attempt beyond McGovern.

O'Neill recognised the need to try and nullify Kimmich's threat and brought on Stuart Dallas at the start of the second period for Hodson, switching to a back four in the process, and the home side were much improved after the break.

Kimmich's quieter second half did not prevent him from getting in on the act as his fine volley beat McGovern at his near post after Marvin Plattenhardt's delivery was headed into the sky by Jonny Evans.

Amazingly, the Green and White Army were still singing at full-time thanks to Magennis heading home from a Brunt corner that was directed to him by McAuley.

A historic win proved beyond Northern Ireland, but the chance to make history by reaching back-to-back finals is still on regardless.