When people look back at the Hall of Fame-worthy careers of Floyd Mayweather Jr. and Cotto, the boxers’ fight on Saturday night at the MGM Grand Garden Arena will be the one they probably remember.

It was a barnburner, one of the most exciting fights of Mayweather’s career; Cotto, of course, is typically in exciting fights. But as usual, it was Mayweather who put his punches together and evaded enough to win, taking a unanimous decision and a junior middleweight title for the second time in his career.

“You’re a helluva champion,” Mayweather said to Cotto in the ring after the fight. “You’re the toughest guy I ever fought.”

Now Mayweather — headed to jail on June 1 for an 87-day sentence at the Clark County Detention Center in Las Vegas for a domestic battery conviction — can offer a new mantra: 43 have tried and now 43 have failed.

“Look, when fights are on pay-per-view, you want to give the fans what they pay for, and that’s excitement,” said Mayweather, who elected to do an in-ring interview with HBO’s Larry Merchant after threatening not to following their blow-up during a postfight interview after Mayweather’s September victory against Victor Ortiz.

Cotto didn’t go down without a fight. He pressed and pushed and cracked Mayweather with many hard punches, probably as many punishing shots as Mayweather has ever been hit with.

Mayweather is 35 now, and maybe the pound-for-pound king has lost just a step, so he is a little easier to hit. But he still got the job done and, for a change, in very exciting fashion.

In picking up his eighth world title belt in five weight classes, Mayweather looked good in victory. But Cotto, 31, a three-division champion in his own right, also looked good. In fact, Cotto gave Mayweather a tougher fight than he gave Manny Pacquiao in their 2009 welterweight title bout, a 12th-round knockout for Pacquiao.

“The judges said I lost the fight. I can’t do anything else. I have to take my defeat,” Cotto said. “I brought my best and I did my best every morning in training camp and I did my best tonight.”

Mentally reborn following his emotional victory against Antonio Margarito in their December rematch, Cotto fought as well as he has in years.

“I’m happy with my fight and with my performance,” he said. “So is my family. I can’t ask for anything else.”

With most of the crowd of 16,047 cheering for Puerto Rico’s Cotto, he was able to bull Mayweather into the corner and make him fight back round after round. And Mayweather was happy to oblige.

Most of the rounds appeared competitive, but Mayweather pulled away to win 118-110 on judge Robert Hoyle’s scorecard, while Dave Moretti and Patricia Morse Jarman each scored it 117-111. ESPN.com had it 116-112 for Mayweather.

Mayweather (43-0, 26 KOs) sat down on his punches and rocked Cotto in the fourth round, turning over his right hand to land several of them flush.

Cotto (37-3, 30 KOs), who made $8 million plus a percentage of the pay-per-view profits, got Mayweather’s respect in the sixth round when he landed a pinpoint jab to his nose, drawing blood. After the punch, Mayweather nodded his head to Cotto out of respect.

“When you come to fight and are in the heat of the battle, those things happen,” Mayweather said.

Every time Cotto trapped Mayweather on the ropes — which he did often and had some success with it — the crowd would go wild. But Mayweather would eventually escape the trouble.

Mayweather closed strong with a huge 12th round, hurting Cotto with a nasty uppercut and right hands.

The fans had gotten their monies worth, and Mayweather had a satisfying victory. HBO will replay the memorable fight, along with the Saul “Canelo” Alvarez-Shane Mosley undercard fight, on May 12 (10:15 p.m. ET/PT).

“He’s a tough competitor,” Mayweather said. “I knew I was going to have to come in the ring to fight hard and execute the game plan. Cotto is a future Hall of Famer and he is no pushover. We fought at his weight class. He came to fight. He didn’t come to survive, he came to fight. So I dug down and fought him back.”

Mayweather, who earned a boxing-record guarantee of $32 million (plus a hefty percentage of the pay-per-view profit), was focused on the fight throughout the promotion, never seeming to let the looming jail sentence unnerve him. He kept up the brave front after the fight, as well.

“You’re dealt obstacles in your life,” Mayweather said. “You have to take the good with the good and the bad with the bad. When June 1 comes, the only thing I can do is accept it.”

Mayweather said he plans to fight again this year after his release from jail. The fight the world wants is to see him face Manny Pacquiao.

Once again, like a broken record, Mayweather made it sound like that won’t happen, despite protests to the contrary.

“Bob Arum is in the way,” Mayweather said of the Top Rank promoter who represents Pacquiao (and once promoted Mayweather). “He’s stopping the fans from getting what they want. Let’s give the fans what they want.”

Mayweather, however, has demanded more than 50 percent of the money in the fight, which has been a nonstarter. He didn’t acknowledge that fact after the Cotto fight. “I’ve been trying to make the Pacquiao fight,” Mayweather said.

Then he turned to his demands for blood and urine drug testing for the fight. Pacquiao has repeatedly agreed, which Mayweather won’t acknowledge.

“Cotto didn’t have the problem taking the random blood and urine tests,” he said. “Why shouldn’t Pacquiao? If he’s the best, take the test.”

That is the same old argument — but for another day. On this night, Mayweather took the test from Cotto inside the ring.

He passed.

Again.