McGregor had been written off before the fight, but the Irishman surprised many of his critics with a largely professional display, taking the fight to 10 rounds.
He got off to a flying start, throwing a series of punches at the 40-year-old and scoring a few early points. Displaying some theatrics, the Irishman even put his hands behind his back at one stage.
As the first round wore on, Mayweather went on the offensive but failed to connect and it was the Irishman who was ahead as the bell rung.
McGregor received a warning in the third round as he illegally connected with Mayweather on the top of the head. Despite the breaches, it was a largely controlled, professional display from the MMA fighter.
Mayweather, meanwhile, struggled to stamp his authority on the contest, receiving blows to the head and failing to make an impact on the 29-year-old opponent.
The American found himself against the ropes early in the fourth round as McGregor went on the attack. Despite apparently trailing the Irishman, Mayweather had time for a wink to the cameras in a show of confidence.
In the seventh, he finally started exerting serious pressure on McGregor, getting him on the ropes and landing a hard left hook.
In the eighth, Mayweather maintained the pressure but McGregor remained defiant, landing some shots of his own.
McGregor got Mayweather on the ropes early in the ninth, but Mayweather battered McGregor with a hard right. With the Irishman clearly tiring and with his legs wobbling, Mayweather moved in for the kill but the Irishman survived the round.
The American finished McGregor off in the 10th round, with the referee stepping in to stop the fight.