Conor McGregor reacts to his majority decision against Nate Diaz. What he does next is almost completely up to him. He could fight at 145 pounds, or 155 or against boxer Floyd Mayweather. (Joshua Dahl/Usa Today Sports)

Conor McGregor has the best mind in mixed martial arts. Sure, the Irishman is sublime with his punching and kicking, too, and those modes of attack have played an indispensable role in making him the star he is. But the most potent weapon he utilizes is inside his head.

McGregor is as gifted a promoter as MMA — and perhaps sports in general — has ever seen. But his mental game is by no means limited to being a loquacious wordsmith. Even when all the self-generated hype and frenzy are swirling around him like a cacophony of high-stakes casino action, he has the exceptional ability to maintain a stabilizing, purposeful presence of mind.

That is what carried McGregor (20-3) through a difficult but ultimately triumphant Saturday night. In the main event of UFC 202 at T-Mobile Arena in Las Vegas, he was called upon to fight off not just Nate Diaz but also himself — first his aggravation, then his weariness — and did so like a Zen master, winning a majority decision after five brutal rounds that only bolstered his crossover star power.

The buildup to this rematch had veered into bedlam during the week, and McGregor, who’s usually the one toying with his opponent in order to win the fight before the fight even starts, had lost his cool. Watching the featherweight champion hurling water bottles around at a chaotic Wednesday news conference, one had to wonder what he would bring to the octagon three nights later.

But when it finally was time to fight, McGregor went into that dark tunnel of his. All of the bluster and blood-boiling were in the deep, murky past. Now he was all about fighting the fight in front of him.

From the start, McGregor launched into a strategy far different from the style of combat that had so drained him in the first Diaz bout back in March. This time, instead of a full-bore pursuit of the knockout, “The Notorious” kept his distance and peppered his opponent’s lead leg with hard kicks. Diaz is at his best when moving forward, generating much of his punching pop by planting his front leg. Now it was getting chopped down, with patience and precision.

But Diaz (19-11) is as durable as they come, and when he finally found his range late in the second round, he quickly turned the fight around. Even after scoring two knockdowns early, McGregor appeared to be fading as the round wore down, just as he had in the first fight. When the 28-year-old Dubliner barely persevered through the third round and sagged on his stool afterward, sucking wind, he looked finished.

He was not. McGregor willed himself to win the fourth, which as it turned out was all he needed. The three judges had already scored Rounds 1 and 2 for him.

So it was mental toughness that got McGregor to the finish line, after mental discipline had given him a head start.

“Like my coach said, we win or we learn,” said McGregor. “I learned from that last contest.”

Of course, that wasn’t the first thing the victor said postfight. Through all of his exhaustion and exhilaration, he remembered the quip Diaz had thrown out at the end of the first fight, one now immortalized on “I’m not surprised, [expletive]” T-shirts. Five months later, McGregor had a retort, playing mind games as usual.

“Surprise, surprise, [expletive],” he said. “The king is back.”

McGregor is indeed the king, and his monarchy extends beyond the eight-sided walls of the UFC. In the wake of this memorable victory — not a dominant one, like most wins in his past, but an inspiring show of a champion’s fortitude — he can write his own ticket going forward. If he wants to pursue that silly but breathtakingly lucrative payday with Floyd Mayweather, it’s in play now more than ever before.

UFC President Dana White insists that McGregor’s next fight will be back at featherweight, the division he rules as an absentee owner of the belt. McGregor became champion in December with a stunning 13-second knockout of long-reigning José Aldo, and immediately set out for bigger and better things. Rather than defending at 145 pounds, McGregor sought to add the 155-pound strap to his collection. But his date with Rafael Dos Anjos was scuttled by an injury to the then-lightweight champ, forcing the UFC to find a replacement foe for McGregor. Enter Diaz.

Now, getting choked out by a guy who’d been partying at the beach just 10 days earlier surely was not part of McGregor’s plan. It left a toxic taste, one he felt he needed to purge. Immediately. It seemed ludicrous to book a rematch, though, as Diaz had finished him emphatically and McGregor had a line of 145-pounders awaiting his return. But the Irishman wouldn’t even consider fighting anyone other than Diaz, and he had built up plenty of goodwill with the UFC brass — he’d twice saved imperiled fight cards by taking late-replacement opponents, and his bouts with Aldo and Diaz had drawn two of the three biggest pay-per-view sales numbers in company history — so the rematch was made.

The featherweight division won’t have to wait for McGregor much longer. Maybe White will get the Aldo rematch that he’s been touting. Or maybe the 145-pounders are just going to have to move on by establishing a new champ.

McGregor always looked like a skeleton while weighing in at 145 pounds. Now that he owns a victory in a higher weight class, and seems to have settled into his added bulk, it seems reasonable to envision him resuming his pursuit of lightweight gold. On Saturday night, he balked at suggestions that Aldo was next, saying, “There’s many things in the pipeline, so sit tight.” Then again, he wasn’t ready to put Aldo and the featherweights in his rear-view mirror for good. Asked about the possibility of him fighting again at a higher weight class and having the UFC strip him of the 145 belt, McGregor said, “How can they do that? What would that do to the division if the guy I KO’d in 13 seconds is champ?”

The UFC will figure out a way. The winner of an Aldo vs. Max Holloway showdown would be a fine champion at featherweight. Expect the promotion to book that fight and put McGregor in with reigning lightweight champ Eddie Alvarez. Will McGregor be stripped beforehand, thus (technically) robbing the showdown of its champion-vs.-champion luster? The UFC will figure that out, too.

It’s a good problem to have, a crossover star just now spreading his wings and taking you along for the ride.