The longest unbeaten run in the history of the All-Ireland senior football championship is over as Dublin finally surrendered their crown - and when it happened, it was fitting that it was Mayo, their greatest foes in the modern era, who administered the blow.

James Horan's youthful and fearless side came of age in a rollercoaster contest, as they first pegged back an intimidating six-point deficit in the second half of normal time and then overwhelmed the champions in an extra-time surge.

Trailing 0-10 to 0-04 after an unpromising first half, Mayo gradually battled their way into the contest, restricting Dublin to a mere three points in the second period.

In a tempestuous finale to normal time, goalkeeper Robbie Hennelly landed a 45, at the second time of asking, to force extra-time.

The Dubs started the added period brightly with Sean Bugler fisting over an immediate score but the champions failed to fire a bullet thereafter.

Mayo's sniping corner forward Tommy Conroy rustled up two points to turn the one-point deficit into a lead.

As Mayo came in waves, Darren Coen curled over a point to put two in it. From the very next attack, Ryan O'Donoghue clipped over a point.

The euphoric Mayo support sensed the momentum had shifted their way and every score and interception was greeted with a frenzied roar.

From there, they saw out the second half of extra-time against a Dublin side suddenly out of ideas, their discipline fraying badly.

The final seconds

The prospect of a landmark win looked remote at half-time.

Shooting into the Canal Stand in the first half - since 2013, all of Dublin's championship wins against Mayo have arrived when shooting into the Canal goal in the second half - Dublin largely controlled the opening 35 minutes.

The champions started as if stung by all the recent commentary on their lethargy, Ciaran Killkenny winning an early free on the 13m line, duly clipped over by Dean Rock.

The absence of Cillian O'Connor was sorely felt early on as wasted chances and poor shooting seemed to sap Mayo's morale.

Rock was booked for a challenge on Conroy but Diarmuid O'Connor failed to connect properly with the resultant free. Mayo wrestled the ball back on the 21, earning a free close to the Hogan Stand. Ryan O'Donoghue pushed his effort wide of the far post.

Moments later, Aidan O'Shea was found with a crossfield ball, his marker slipped, allowing him the space to either dart towards goal or take a leisurely point. In the end, he took a leisurely wide.

Down the other end, the champions weren't having any such problems. Ciaran Kilkenny, in imperious form, curled over a score, Rock added one from play. Con O'Callaghan, so curiously off-colour in the Leinster final, got in behind the defensive line, fisted a point from a tight angle to make it 0-04 to 0-00.

It was the 12th minute before Mayo did get off the mark, midfielder Matthew Ruane hoisting over a badly needed score from long range.

Kilkenny and Rock added further points to push Dublin's tally out to six by the water-break, at the other end, O'Donoghue sliding to take a mark and this time nailing his free-shot.

On 22 minutes, the Dublin fans let go possibly their most ecstatic cheer of the evening when O'Shea, badly out of sorts, fielded the ball inside the 21 metre line, appeared to take a split second to ponder his options before hurriedly calling for a rather belated mark, generously allowed by referee Conor Lane.

His generosity was of little use to Mayo. O'Shea, from 14 metres out, pushed his free shot horribly off the near post and wide.

All was going swimmingly in front of goal at the Canal side, Dean Rock clipping over frees at every opportunity presented.

Dublin, so often dragged into the mire by Mayo's aggression, were, at this point, managing the game like it was an early summer Leinster championship encounter.

When Paddy Small rounded off a characteristically lengthy and measured passing move by curling over a delightful point on the half-hour mark, the lead was pushed out to seven and the home crowd were in their usual contented mood.

Hennelly, so prominent late on, did canter up the pitch, to convert his first free of the game and Mayo's third of the game and Conor Loftus's fine point left it at 10-4 at half-time.

Still, there was a resigned air among the neutrals and those hungry for change at the break, with many muttering that the game was over.

It initially seemed Dublin weren't intent on dawdling in the third quarter, James McCarthy being put clean through on the restart. However, he shanked his shot wide of the near post.

Slowly, however, Mayo got a handle on their task and when Ryan O'Donoghue swooped over a point from distance, the resulting cacophony suggested Mayo fans were tentatively beginning to believe again.

John Small and Diarmuid O'Connor tussle for possession

While their passing was still marked by looseness, their abrasive defenders gradually exerted their influence on the game, Lee Keegan and the combative Padraig O'Hora beginning to force turnovers with regularity. Dublin's attacking moves, so measured and potent in the first half, were now being snuffed out as soon as they traversed the 40m line.

Scores came dropping slow but what scores arrived went Mayo's way. With almost 50 minutes on the clock, Hennelly stepped out again to drill over his second long range free and a minute later, the Mayo wall of noise ratcheted up further when the tireless Keegan curled a long range effort just inside the near post.

Lane's permissiveness in adjudging tackles generated controversy shortly after the 50th minute, when John Small barrelled into Eoghan McLaughlin.

With the Mayo wing back prone on the floor, Dublin coursed forward, Colm Basquel raging through on goal before screwing his shot wide of the far post.

The boos rose as Lane trotted back to inspect McLaughlin's condition. On the sideline, James Horan was wound up by the tackle, roaring various irate comments in the direction of the officials, no lip-reading expertise required. The wing-back lay on the ground for seven minutes before a stretcher arrived to cart him away. After the match, Horan confirmed he was in "some discomfort" and was taken to hospital, accompanied by the medical team.

Mayo fans were surely cursing the intrusion of the water-break as it initially appeared to kill their momentum and Dublin engineered two quick scores, their first of the half, immediately upon the re-start, Paddy Small curling over one off his left after a patient move and the Dean Rock, plucking a mis-hit shot out of the sky, after forcing over a score under pressure.

The gap was out to five again but the Dubs, it turned out, were not over the hump.

Mayo saved their biggest burst of the match for the closing 10 minutes. Diarmuid O'Connor's devotion to chasing lost causes seemed to have a major inspirational effect.

Hennelly, whose long range free-taking was assured all day, blazed one which appeared to be drifting well wide. While the Dublin support were still mid-ironic cheer, O'Connor dived across to prevent the ball going wide, somehow hacking the ball back in-field. A second later, Kevin McLoughlin was stooping to pick up the retrieved ball and slotting his first and only point of the evening.

Diarmuid O'Connor keeping the move alive

Hawkeye alerted Conor Lane that it wanted to take a look at Jordan Flynn's point, much to the frustration of the Mayo support, but the verdict of the technology was 'Tá'.

O'Donoghue clipped over a free, then Conroy, now buzzing with energy and impishness, slipped over a fine score from play.

Entering the elongated period of injury-time, fixed at seven minutes due to the stoppage for the McLaughlin incident, Dublin held a slender advantage.

Paddy Small, one of Dublin's more impressive attackers on the day, cleverly manufactured a free in an unpromising situation near the Hogan Stand sideline. Rock, peerless in those situations, curled over a perfectly struck free. Dublin looked like they might squeeze through after all.

But Mayo were still unbowed and coursing with belief. Ryan O'Donoghue clipped over a handy free after a cynical pull-back by Davey Byrne, somehow not punished with a black card.

At 13-12, we were closing in on the 77 minute mark. The Dubs had possession and we appeared set for another exhibition of winding down the clock, a la 2017.

However, the Leinster champions were rattled and their nervy attempts at keeping possession saw them shuffle the ball closer and closer to their own goal, as the crowd bayed for a turnover. Eventually, they got too near to the end-line and a pumped-up Mayo forced the 45.

It was a disconcerting spectacle for a team renowned for being so robotically assured in those situations. Mayo had another chance.

Standing over a knee-knocking 45, Hennelly blazed his first effort well-wide to the premature delight of the capital followers. But it was immediately apparent things were awry, Lane spotting some encroachment by subs scampering onto the pitch.

The re-take was ordered and this time, Hennelly's strike was true. Given all the stoppages in injury-time itself, it was assumed that another couple of minutes were there to be played but with a melee brewing and then breaking out on the field, Lane decided to call a halt.

Robbie Hennelly striking the last minute free

Extra-time was required. Mayo weren't to be denied.

Brushing off the irritant of Bugler's early fisted score, the Connacht champions kicked for home, Conroy in particular coming into his own.

The Dubs were a beaten docket by the second period, forced to rustle up scores in a hurry. As the clock became their enemy, we were treated to the bewildering spectacle of the six-in-a-row champions punting hopeful balls into the mixer, none yielding any result, apart from a Costello half-chance, blocked out for a 45.

In the chaotic finale, they'd only 13 men on the field, James McCarthy and Tom Lahiff being shown black cards with the writing looming large on the wall.

For a few of their number, Brian Fenton and Con O'Callaghan among them, it's a first taste of championship defeat after years feasting on success.

Eight months ago, the teams met in a deserted Croke Park on the last Saturday before Christmas. The accompanying atmosphere, even with a restricted attendance, was dramatically different this time, the old wall of noise returning to GAA HQ.

After a grand total of 2,540 days, Dublin have been beaten in the championship again and Mayo are through to yet another decider, their 11th since 1989.

Dublin: Evan Comerford; Michael Fitzsimons, Davey Byrne, Jonny Cooper; James McCarthy, John Small, Eoin Murchan; Brian Fenton, Brian Howard; Paddy Small (0-02), Ciarán Kilkenny (0-03, 1m), Niall Scully; Dean Rock (0-07, 2f), Con O'Callaghan (0-01), Cormac Costello

Subs used: Colm Basquel for Costello (49), Tom Lahiff for Cooper (51), Sean Bugler (0-01) for Scully (61), Sean MacMahon for Murchan (67), Philly MacMahon for MacMahon (76), Robert McDaid for Small (81), Aaron Byrne for Howard (82), Costello for Paddy Small (85)

Mayo: Rob Hennelly (0-03, 3f); Padraig O'Hora, Lee Keegan, Michael Plunkett; Paddy Durcan, Stephen Coen, Eoghan McLaughlin; Matthew Ruane (0-01), Conor Loftus (0-01); Diarmuid O'Connor, Kevin McLoughlin (0-01), Darren McHale; Tommy Conroy (0-03), Aidan O'Shea, Ryan O'Donoghue (0-05, 2f, 1m).

Subs used: Enda Hession for McHale (27), Bryan Walsh for Plunkett (49) James Carr for O'Shea (49), Jordan Flynn (0-01) for McLaughlin (57), Conor O'Shea for Loftus (64) Darren Coen (0-01) for Stephen Coen (75), Loftus for McLoughlin (81) Brendan Harrison for O'Connor (87), Aidan O'Shea for Coen (90)

Referee: Conor Lane (Cork)