By Joe Callaghan in Las Vegas

Conor McGregor survived the toughest test of his career to come out on top in a war of pure and utter attrition against Nate Diaz at the T-Mobile Arena, Las Vegas.

The headline event of UFC 202 had been billed as being all about revenge after Diaz's stunning submission of the Notorious in March. There was to be revenge in Las Vegas but it was nowhere near swift as a fight for the mixed martial arts ages went the distance in front on an enraptured crowd.

McGregor dropped Diaz three times in the opening two rounds but each time summoned his rival back off the canvas and was then dragged into the deepest fight of his career, going five rounds for the first time.

It was brutal but bewitching stuff as they went toe to toe to the death with McGregor ending the fight on his back only to be helped up by Diaz after the bell.

As we went to the scorecards, the crowd saluted two heroically resilient performances. McGregor took the decision on two judges cards with another calling it a tie to get his UFC career right back on track.

McGregor's stratospheric rise to the top of the mixed martial arts world and gatecrashing of the mainstream - the likes of Kanye West, Niall Horan, NBA and NFL big names were all present for this outing - took less than two years. A loss here would have represented a much more precipitous plummet to uncertainty.

McGregor entered an arena that was buzzing but not nearly as boozy and wild as those that have greeted his three most recent Sin City outings with the crowd very much split in its favouritism, in spite of late surge of Irish fans.

After the riotous scenes involving the duo at their press conference on Wednesday a wall of nine Nevada State Athletic Commission officials separated the pair during the pre-fight ceremonies.

Once the ring was cleared they went at it early and often, McGregor bloodying and bruising Diaz with big lefts in the first then dropping him to the floor, something he hadn't done first time round. He summoned the veteran back and they traded shots that left Diaz's right eye bruised.

It was bloodied early in the second as McGregor mixed things up, landing leg kicks as well as strikes. He was getting caught too but soon had Diaz back on the ground twice in quick succession, ignoring the opportunity to take the fight to the ground

He could have lived to regret it as Diaz responded in some style late in the second landing a hard combo that rocked McGregor. It was enthralling fare.

McGregor's decision not to capitalise on his early dominance looked even more flawed in the third as Diaz took command landing plenty and looking for a takedown that didn't materialise. It was clear however that the Californian had now dragged McGregor into a war. 

A war was what they served up in the final two rounds, McGregor's gruelling pre-fight camp paying off as he kept his composure and defended well, even if his continual walking away upset the crowds.

Diaz's corner told him he needed to win the fifth round as the T-Mobile Arena saluted the fighters before the closing stanza. McGregor actually turned his back at one stage as he looked to stay out of danger but they were soon back grappling against the cage as energy levels ran empty.

In the end Diaz got his takedown with the clock running out but it's wasn't to be enough as the Dubliner's hand was raised soon after, with Diaz already looking forward to a third encounter to settle matters.

“I came here to fight. I want number three, I gave him number two, so let’s do it," he said afterwards. 

The cost of these two non-title bouts could be telling on McGregor, but his status as the biggest draw in the sport has been emphatically confirmed.

McGregor may have spent much of the past five months in the bad books of his employers but the payment ledgers showed his return as another record-setting night. The featherweight champion earned the highest disclosed purse in MMA history here, taking a base salary of $3m, breaking Brock Lesnar's one-off UFC 200 payday by 20 per cent.

Diaz may have spent his recent years complaining about being shunned by the UFC when it came to earnings and profile but his reward for stunning the sport and suffocating McGregor in March was a four-fold financial jump - from $500,000 to $2m.

Neither fee includes pay-per-view payments however with McGregor expected to again clear $10m for his night's work.