Undefeated boxer Floyd Mayweather and mixed martial arts champion Conor McGregor, two of the most popular athletes in their respective sports, have agreed to a crossover fight in the ring on August 26 in Las Vegas.

The fight confirmed on Wednesday is expected to gross millions of dollars, with Mayweather a solid favourite.

Mayweather, 40, retired in 2015 with an unblemished 49-0 professional boxing record while boastful Irishman McGregor, 28, is the UFC's lightweight champion.

"IT'S OFFICIAL!!!" Mayweather wrote on his Twitter account alongside a short video that included photos of both fighters.

"THE FIGHT IS ON," McGregor tweeted minutes before Mayweather's post.

The two fighters had gone back and forth for nearly a year on the showdown, each demanding $100 million (78.4 million pounds) for the fight.

Both camps declined to disclose financial details during a call with reporters but said all sides were satisfied.

"Nobody is bummed out about this deal," UFC president Dana White said.

"Everybody's happy," Mayweather Promotions CEO Leonard Ellerbe said.

White told ESPN that the 12-round fight would take place at the T-Mobile Arena and that McGregor would weigh in at 154 pounds.

Mayweather Promotions will publicize the event, which will be available on Showtime pay-per-view.

"I talked to Conor McGregor this morning," White said. "He is absolutely, 100 percent positive that he wins this fight."

If McGregor pulls that off, it would rank among the greatest boxing upsets of all time.

Mayweather is widely regarded as one of the best defensive fighters ever, and prides himself on his ability to evade punishment with his movement and to make adjustments on the fly.

McGregor, the UFC's reigning lightweight champion and former featherweight champion, is known as much for his bravado as for his explosive knockout power inside an MMA octagon.

The Irishman became the first UFC fighter to hold two belts simultaneously when he knocked out Eddie Alvarez in New York last November for the lightweight championship.

Known for his devastating striking and highlight-reel knockouts, McGregor is also quick on his feet but few would back him to beat one of the most complete boxers of all time.

A win for Mayweather would move him ahead of former heavyweight great Rocky Marciano, who also retired with a perfect 49-0 career record.

Showtime Sports executive vice president Stephen Espinoza said the fight had the potential to appeal to an entirely new category of fans.

"We're not only drawing from the universe of boxing fans and the universe of MMA fans, we've actually tapped into the audience that doesn't follow either sport," he said.

"This is an unprecedented event."