This wasn't the way Miguel Cotto planned to leave boxing.

Sadam Ali ruined the Garden party for Cotto on Saturday night, sending the Puerto Rican star into retirement with 12-round defeat by unanimous decision. It was a matchup of a Brooklynite and an adopted New Yorker, and it has the building rocking.

The 37-year-old Cotto simply couldn't handle the quickness of his younger opponent, who took the WBO junior middleweight belt. Ali did it despite being the less-popular fighter only miles from his borough; Cotto has made MSG a second home, but fell to 8-2 in the arena.

"I had him hurt here or there in the first couple of rounds," Ali said. "I knew I had to do something, or he would have dug in."

Cotto finishes 41-6, and he looked his age far too often. He hurt his left arm in the seventh round in losing by scores of 115-113, 115-113, and 116-112.

Many of the 12,371 fans booed the decision and again when Ali spoke in the ring.

"I worked hard for it," the 29-year-old Ali said. "I took advantage of this fight, and I made sure to make it count. I want to thank team Cotto, they could have taken an easier fight if they wanted to. "

Cotto had received a thunderous ovation when he entered the ring, and they were chanting his name as he left, proud but defeated.

Ali is 26-1. He started quickly, then was stunned by a big right from Cotto that staggered him. Cotto charged as Ali recovered at the ropes, but it looked as if the fight had turned.

It hadn't. Indeed, Ali won the final four rounds on all three judges' cards.

Ali lost his previous title fight to Jessie Vargas in 2016 when he was stopped in the ninth round in a welterweight match.

Now, he becomes a force in this division. His hand speed and movement around the ring made him formidable Saturday night.

"Good things happen to good people," Ali said. "I have been training since I was 8 years old, and I am glad I got this win at MSG, in my hometown."

Cotto, meanwhile, leaves boxing with a legacy that can't be tarnished by this loss.