Mayweather confirmed the bout - which will take place under normal boxing rules despite McGregor having never boxed either amateur or professionally - on his official Twitter feed.
Mayweather will be coming out of retirement at age 40 to fight McGregor.
UFC Chairman Dana White also expressed his joy with a simple smiley emoji on social media.
However, Mayweather's former rival in the ring, Oscar De La Hoya, has said the fight would harm boxing.More news: Korea President: Trump and I Have Common Goal
While further details were unavailable as of Wednesday afternoon, it's expected that each fighter could earn in excess of $100 million United States for the match.
Though Las Vegas oddsmakers have made Mayweather a heavy 10-1 favourite, the thought of the fight has excited many in the MMA world.
White wasn't willing to make a prediction on the outcome of the fight, but he stressed just how unique the McGregor/Mayweather clash is.
"I talked to Conor McGregor this morning". And with the fight distributed via Showtime pay-per-view with Mayweather Promotions as the lead promoter, that answer is "probably around £78.4m each". "We've been in negotiations now for a while, and to be honest with you, negotiations went smooth", White said. McGregor is 21-3 as an MMA fighter and has won UFC championships at 145 and 155 pounds. I don't think it damages the brand or Conor McGregor at all. The biggest question left to answer: will people actually tune in to watch McGregor and Mayweather go at it?
It followed a successful defence of his WBC and WBA welterweight titles, a victory that equalled Rocky Marciano's career record of 49-0.