What began as talk for a fight many perceived as impossible between a boxing legend and the biggest star in mixed martial arts is now a reality.

Former pound-for-pound king and five-division world champion Floyd Mayweather Jr. made the official announcement on social media on Wednesday, confirming that he will exit a 23-month retirement at age 40 to face Conor McGregor, the UFC superstar, in a boxing match on Aug. 26 in Las Vegas.

UFC president Dana White, appearing on SportsCenter, said the fight would be at the boxing junior middleweight weight limit of 154 pounds, the fighters would use 10-ounce gloves and the card would take place at T-Mobile Arena.

The fight will be broadcast on Showtime PPV.

"We've been in negotiations for a while," White told SportsCenter. "Negotiations went smooth. Floyd is surrounded by some smart people, and we got this thing done. The impossible deal is now done."

Moments before Mayweather's announcement, McGregor sent out a simple four-word statement on Twitter, with a picture of Floyd Mayweather Sr., instead of Mayweather Jr.

White followed the announcement with an emoji.

THE FIGHT IS ON. pic.twitter.com/KhW0u3jRft — Conor McGregor (@TheNotoriousMMA) June 14, 2017

😃 — Dana White (@danawhite) June 14, 2017

The announcement brings to an end rampant speculation that began two years ago, when McGregor threw out the prospect of the fantasy match during a July 2015 appearance on Conan O'Brien's talk show, telling the host, "I would box him if the opportunity arose."

Ireland's McGregor (21-3), a 28-year-old southpaw, is the first UFC fighter to simultaneously hold titles in two different divisions and one of the best MMA fighters in the world, but he will be making his professional boxing debut against Mayweather, one of the greatest boxers in history.

Although no major titles are on the line and Mayweather (49-0, 26 KOs) is an astronomical favorite, the fight offers both combatants an opportunity to make huge money.

Mayweather is a -1,100 favorite at the Westgate SuperBook in Las Vegas, with McGregor paying back +700.

McGregor has been outspoken about his desire for a fight that will dwarf his largest UFC payday, while Mayweather, who earned some $250 million for his record-shattering victory against Manny Pacquiao in May 2015, stands to earn a second nine-figure windfall.

Mayweather (49-0, 26 KOs) also has the chance to finish off his career at a perfect 50-0 in a bout that few expect to be competitive but has nonetheless piqued the public's interest because of the boxing-versus-MMA angle, not to mention the big personalities and trash-talk ability of both fighters.

Mayweather has not fought since easily outpointing Andre Berto in September 2015 to retain his welterweight world title and then retiring. But he has been vocal about his desire to exit retirement for only one fight -- the big one against McGregor.

The fight seemed highly implausible because Mayweather was retired and McGregor had never boxed. Mayweather and McGregor eventually went back and forth with each other in the media and on social media talking about a possible fight, but making a deal was another story.

Conor McGregor, 28, the first UFC fighter to hold titles in two different divisions at the same time, is a huge underdog for his 12-round boxing match against 40-year-old Floyd Mayweather Jr. on Aug. 26 in Las Vegas. Jason Silva/Zuma Press/Icon Sportswire

McGregor fueled speculation when he applied for and was granted a boxing license in California in November and then applied for one in Nevada last month, although his application has not yet been completed.

But McGregor, whose UFC titles have come at 145 and 155 pounds, is under long-term contract to the UFC and needed the company to go along with making the bout. White was initially against it, but he came around and in April admitted there was too much money at stake not to make the fight. In May, McGregor and the UFC came to terms on their end of the deal.

Mayweather also began to talk openly about his interest in the fight, announcing in March that he would come out of retirement for only one opponent -- McGregor. He hoped the bout would take place in June, but that was pushing the timing, and in May, he told Showtime on one of its boxing telecasts, "Hopefully, we can make the fight happen. He's no pushover."

McGregor caused even more of a stir in March when he was ringside for the boxing pro debut of his pal Michael Conlan and went off in a brief session with the ringside media after the fight, shouting, "I'm going to step in there and shock the whole goddamn world. Trust me on that. Look me in the eyes, 28 years of age, confident as a m-----f-----, long, rangy, dangerous with every hand. Trust me, I'm going to stop Floyd and you're all going to eat your words. The whole world is going to eat their words."

With Mayweather adviser Al Haymon quietly negotiating the specifics with the UFC -- and the Nevada State Athletic Commission saying it would happily regulate the fight, despite it being perceived as a huge mismatch by most -- Mayweather Promotions drew attention when it requested Aug. 26 from the Nevada commission as the date for a boxing event, although it did not specify the main event.

It nonetheless became clear through various sources that this was the intended date for Mayweather-McGregor. On Wednesday, the commission granted Mayweather's company the date at its regular commission meeting; although Mayweather Promotions had asked for the request to be removed from the agenda, only to make a last-minute request to keep it on Tuesday night.

Hours after the commission approved the date request for the fight, Mayweather announced the fight that many believe will approach the 4.6 million buy record set by Mayweather-Pacquiao.

"This matchup is unprecedented," said Stephen Espinoza, executive vice president and general manager of Showtime Sports. "There has been overwhelming demand from fight fans, and it's great to be able to deliver.

"As we've already seen this evening, Mayweather vs. McGregor has generated buzz that reaches far beyond that of the considerable boxing and MMA audience. Both Floyd and Conor are trendsetting personalities who've transcended their respective sports. They carry unmatched reputations for spectacle and athleticism, and together they will create a once-in-a-lifetime event."

The Mayweather-McGregor card will be boxing only, and Mayweather has said he wants two of his company's top fighters to appear on it: Badou Jack (21-1-2, 12 KOs), a former super middleweight world titleholder who vacated his belt in January to move up to light heavyweight; and junior lightweight world titlist Gervonta Davis (18-0, 17 KOs).

"Like sports fans worldwide, we are thrilled that the Mayweather-McGregor fight has been finalized and will take place later this summer in Las Vegas," said Richard Sturm, president of entertainment and sports for MGM Resorts International, which owns T-Mobile Arena. "This will be a sensational event, one that we're all looking forward to in August. It will be an experience for fans that will, once again, prove why Las Vegas is the entertainment capital of the world."

ESPN's Brett Okamoto and Ben Fawkes contributed to this report.