Ireland produced a performance for the ages to hand New Zealand their first defeat in Europe since 2012.

It was only the hosts' second ever win over the All Blacks in 31 Test matches and their first on home soil from 16 attempts. 

Joe Schmidt's men never trailed with Johnny Sexton kicking 11 points and Jacob Stockdale scoring a superb second-half try to deny the back-to-back world champions.

The win was all the more impressive given that Schmidt had to cope without frontline men Conor Murray, Robbie Henshaw, Sean O'Brien and Dan Leavy. 

It was far from plain sailing, however, and the Dublin crowd had to endure a near carbon copy finish of the last-gasp defeat in 2013. 

Ireland, leading by seven, had possession with two minutes to play but kicked and had to defend for their lives as Steve Hansen's men worked the ball from deep. 

They made it all the way to the 22 before a dropped pass signalled the end of the match. 

"We're building nicely," said man of the match Peter O'Mahony. "It's a big piece of history for us."

Billed as a battle between the world's top ranked sides, Ireland got off to a stirring start. 

With New Zealand building up phases close to the line and eager to grab an early score to quieten the boisterous Aviva crowd, CJ Stander came up with a steal to relive the pressure. 

The Irish defensive line stayed a straight as a die during the early stages, not leaving any gaps as Damien McKenzie and Ben Smith probed across the field.  

Ireland were first to strike when Sexton tapped over after Kieran Read failed to roll away in time.

Indeed, it looked as if that lead would be extended but Rory Best, guilty of trying too hard in the first half, lost the ball in contact and quick as a flash the All Blacks made it to the Irish 22 from where Beauden Barrett landed a penalty from the sideline.

But the hosts, now on a run off 11 straight home wins, were bossing possession and territory, and forced the world champions to make 106 tackles to their 74 in the first half alone.

Ireland twice thought they had breached the line when, firstly, Stander was held up over the line and then Rob Kearney was denied a rare try by the TMO.

The only consolation was Sexton's second penalty for another offside, but Barrett soon landed a dropgoal while playing advantage to level matters again.

The game was tight but the pace was electric, prompting centre Ryan Crotty to remark to referee Wayne Barnes: "Not a bad tempo, eh?"

More Ireland pressure followed – James Ryan, Cian Healy and O'Mahony the ever-willing ball carriers and, after initially kicking to the corner, Sexton, nominated along with Barrett for the World Player of the Year award, pushed the hosts into a 9-6 half-time lead with his third penalty.

And eight minutes into the second half, Stockdale then came up with his moment of magic, the winger's way paved by a superb O'Mahony turnover.

The Six Nations top try-scorer, minutes after being blocked down by Read, was the linchpin of a training-ground move as he collected his own chip before sliding over - the Fields of Athenry erupting around Lansdowne Road as Sexton converted.

The Rugby Championship winners tried to hit back but Kearney denied Ardie Savea in a foot race and O'Mahony appeared like a ghost to prevent Barrett's dink finding Smith, who looked certain to score.

Seconds later the man of the match Munster captain was on hand to win another penalty at a ruck, his last action before being replaced by Jordi Murphy.

Barrett almost snuck through but again Kearney found himself in just the right place to deny the out-half. 

The Hurricanes man kicked a penalty to reduced to the margin to a converted try with 11 minutes to play and Ireland had to hang on. 

The All Blacks stole an Irish lineout and Barnes gave them a scrum after the ball had been kicked away. It looked like they would work a score but Ireland believed and the line held firm. 

Almost neck and neck in metres gained, passes, tackles and missed tackles, Ireland won the penalty count 11-5 and Schmidt had his second win over his native country in two years. 

Ireland: Rob Kearney; Keith Earls, Garry Ringrose, Bundee Aki, Jacob Stockdale; Johnny Sexton, Kieran Marmion; Cian Healy, Rory Best (cap), Tadhg Furlong; Devin Toner, James Ryan; Peter O'Mahony, Josh van der Flier, CJ Stander.

Replacements: Sean Cronin, Jack McGrath, Andrew Porter, Iain Henderson, Jordi Murphy, Luke McGrath, Joey Carbery, Jordan Larmour.

New Zealand: Damian McKenzie; Ben Smith, Jack Goodhue, Ryan Crotty, Rieko Ioane; Beauden Barrett, Aaron Smith; Karl Tu'inukuafe, Codie Taylor, Owen Franks; Sam Whitelock Brodie Retallick, Liam Squire; Ardie Savea, Kieran Read (cap).

Replacements: Dane Coles, Ofa Tuungafasi, Nepo Laulala, Scott Barrett, Matt Todd, TJ Perenara, Richie Mo'unga, Anton Lienert-Brown