Mayweather, 40, who will come out of retirement for the boxing match, is undefeated in his previous 49 bouts, while Irishman McGregor, 28, is the only UFC fighter to hold a world title in two different weight divisions.
Mayweather, who retired from the sport in September 2015, took to social media on Wednesday night to confirm that the fight would be going ahead in Las Vegas, while McGregor simply posted "the fight is on" as he prepares for his first professional boxing bout.
It will be the first time that a current UFC champion has taken on a boxer in a boxing match, and the announcement brings to an end almost a year of talks between the two parties.
THE FIGHT IS ON. pic.twitter.com/KhW0u3jRft— Conor McGregor (@TheNotoriousMMA) June 14, 2017
The fight, which is expected to be the most lucrative in history, will be sanctioned by the Nevada Athletic Commission.