17 years as a pro. 41 wins. World titles in four weight classes.

Those were the accomplishments Miguel Cotto brought into the ring one last time, when he walked out at Madison Square Garden with no music playing, basking in the moment, nothing distracting him from the adulation of a crowd that had roared for him so often before and would never get to do so again once this night — and his career — was over.

Those are the same accomplishments that Cotto leaves with, never mind the loss he suffered in what was already planned to be his last fight and, judging by the way it turned out, very well should be.

Cotto dropped a unanimous decision to Sadam Ali on Saturday. It is not the way he wanted to hang up his gloves. However, it is not the way he will be remembered.

He didn’t embarrass himself against Ali. He was not blown away, neither blasted out nor beaten up in the way that happens to too many fighters when they grow too old and have gone on too long.

He just didn’t have what it takes anymore to compete at a certain level anymore. Ali was at best a contender at welterweight, and he was untested at junior middleweight, where this fight took place. But Ali is otherwise a competent fighter. He has a good amateur pedigree, representing the United States in the 2008 Olympics. Ali has good hand speed and decent technique.

Ali was able to hurt Cotto with a right hand to the side of the head in Round 2. Ali landed a left hook to the temple in Round 4 that once again left Cotto on shaky legs. Ali threw and then moved in those early rounds, making sure not to get caught up in exchanges nor remain in range for too many of Cotto’s vaunted body shots.

Cotto bounced back, driving Ali backward in Round 6 with a right hand. But he hurt his left arm in Round 7, injuring his biceps muscle. Ali took over, landing eye-catching blows in Round 8 and Round 10, and took the lead on the scorecards for a unanimous decision.

Two judges had it 115-113, seven rounds to Ali and five to Cotto. The other judge had it 116-112, eight rounds to Ali and four to Cotto. Those were the right scores.

That brought Cotto’s record to 41-6 with 33 knockouts. It wasn’t the goodbye he had hoped for, but it was a fitting goodbye nonetheless for a 37-year-old whose best days are behind him.

He was fighting once more in the building long lauded as the Mecca of Boxing. Cotto, a native of Puerto Rico, had made Madison Square Garden a second home, drawing upon his Boricua faithful again and again, headlining in the arena 10 times in total.

His first time, back in 2005, brought a technical knockout of Muhammad Abdullaev that served as a form of revenge. Abdullaev had beaten Cotto in the 2000 Olympics. Abdullaev went on to win gold. Cotto went on to a far better pro career.

Cotto returned to Madison Square Garden to defeat Paulie Malignaggi, Zab Judah, Shane Mosley, Michael Jennings, Antonio Margarito, Sergio Martinez and Ali. His lone defeat there came against Austin Trout in 2012.

Those were just part of a lengthy and successful career.

Cotto was spotlighted on pay-per-view undercards in the early years, back when he was still a prospect, one that his then-promoter, Top Rank, clearly believed in. Under their expert guidance, Cotto was further developed into a dangerous contender and maneuvered toward a title shot, defeating recognizable names such as Carlos Maussa and Lovemore Ndou along the way.

He captured a vacant belt at 140 pounds in 2004, taking out Kelson Pinto. Cotto made six successful defenses of the title, picking up victories over the likes of Randall Bailey, DeMarcus Corley, Abdullaev, Ricardo Torres, Gianluca Branco and Malignaggi.

He was formidable though not invincible. Cotto was staggered against Corley and traded knockdowns in a thriller with Torres. That only helped raise Cotto’s esteem in the eyes of the passionate Puerto Rican boxing fans. Cotto could never get to the level of beloved superstar Felix Trinidad, but that was always going to be an unfair comparison. He was nonetheless becoming a superstar of his own accord.

Cotto soon moved up to 147, won a vacant world title against Carlos Quintana in 2006 and made four successful defenses, including a battle with Zab Judah and a very good victory over Shane Mosley.

Then Cotto ran into Antonio Margarito in 2008. It was a hellacious war. Cotto fought valiantly, only to succumb to an accumulation of punishment, calling it a night in the 11th round. Cotto came back with another vacant title win, then defended with a split decision against Joshua Clottey.

Next came a huge fight with Manny Pacquiao. Cotto was dropped twice and dissected over the course of the fight until the plug was finally pulled in the final round.

Cotto then moved up to junior middleweight, defeating Yuri Foreman in 2010 for a world title in a third weight class, defeating Ricardo Mayorga and stopping Margarito for an emotional victory over his hated rival. Cotto went on to face Floyd Mayweather Jr., putting forth a good effort but losing clearly. He wrapped up 2012 with a second straight loss, dropping a wide decision to Austin Trout.

Perhaps that was a sign that Cotto was declining. Then again, those two defeats came against one great fighter and one good one.

He came back for one last run.

Cotto returned in 2013 with a victory, then stepped up in 2014 by challenging for the true middleweight championship against Sergio Martinez. Cotto brought Madison Square Garden to a deafening roar in the first round, putting Martinez down on the canvas three times and dominating him en route to a 10th-round stoppage.

His reign lasted a year and a half and included just one successful defense. Cotto lost the championship to Canelo Alvarez in late 2015. Cotto disputed the result, which otherwise was just.

Cotto didn’t return again until this past summer, looking good against a willing punching bag named Yoshihiro Kamegai. That was his last victory.

Cotto had said before that he would retire by the end of this year, no matter who he fought, no matter how he did, despite his oft-stated hope for a rematch with Canelo. But there would be no rematch, not once Canelo opted instead to face Gennady Golovkin, and not with Canelo likely facing Golovkin again next year.

A fighter who is thinking about retiring probably should. It means his mind is no longer wholly committed to a sport that requires complete dedication. You can’t blame any fighter for eventually thinking about a world outside of boxing, though. Cotto had been doing this professionally since the beginning of 2001. He had years of boxing as an amateur before that.

This has been his life. Yet life goes on.

Cotto’s legacy is set: 17 years as a pro. 41 wins. World titles in four weight classes.

You can debate his place in the pantheon of greats. You can argue that he was never the best at 140 or 147, though you can also admit that he was at least near the top in those divisions. His resume is less impressive at 154. He was the legit champion at 160, the man who beat the man, and so on. That still comes with a caveat, as Martinez was essentially a one-legged fighter who had never fully recovered from injuries and surgery. Cotto then beat former titleholder Daniel Geale, who was drained to a catchweight and taken out in four.

Don’t let that debate take away from the respect that Cotto rightfully deserves.

He beat some very good fighters and lost when he was willing to take on tough challenges. He fought with passion and skill and heart and guts. He did that until his last, fighting on against Ali despite being buzzed multiple times and injured for essentially half the bout.

This is the end for Miguel Cotto. But what a ride he had along the way…