The unbeaten American made the announcement via the social media website Shots.com.
“What the world has been waiting for has arrived. Mayweather vs. Pacquiao on May 2, 2015, is a done deal,” Mayweather wrote.
“I promised the fans we would get this done, and we did.”
Eight-division world champion Pacquiao dedicated the fight to fans who “willed” it into being.
“I am very happy that Floyd Mayweather and I can give the fans the fight they have wanted for so many years,” he said. “They have waited long enough and they deserve it.
The welterweight world title showdown is sure to be the most lucrative in boxing history, generating massive pay-per-view revenue.
More importantly for fans, it will finally pit the two boxers long considered the best “pound-for-pound” fighters of their generation against each other.
Previous bids to put together a fight between Pacquiao and Mayweather had run aground over various issues, including a drug testing protocol.
US media reported the contract Mayweather signed for the fight gives the American 60 percent of the purse.
Pacquiao said last week he had agreed to the drug-testing procedures Mayweather wanted as well as other demands, and he believed an announcement of the fight was imminent.
Because each fighter is contracted to a different US telecaster, contracts also had to be signed by rivals Showtime and HBO, who will team for an historic joint pay-per-view.
It is the second time Showtime and HBO have made such a deal. In 2002 they teamed for the fight between then-heavyweight champion Lennox Lewis, who was with HBO, and former champion Mike Tyson, who was with Showtime.
“It’s going to be a great fight,” said Pacquiao’s promoter Bob Arum. “We are confident our fighter Manny Pacquiao will emerge victorious.”