NEW YORK -- For more than 20 years, Chael Sonnen prided himself as a mixed martial artist who would "always make the walk." On Friday, he did so for the final time.

Sonnen, 42, retired in the Bellator MMA cage Friday following a second-round TKO loss to former UFC champion Lyoto Machida. The 205-pound bout co-headlined Bellator 222, which took place inside Madison Square Garden.

The announcement brings Sonnen's 22-year professional career to an end. The Oregon native, who is also an MMA analyst for ESPN, finishes with a final record of 30-17-1.

"I had a hell of a lot of fun," Sonnen said in his postfight interview. "I had a good run. I'm walking out. I appreciate the memories, and goodbye."

Sonnen said he had no thoughts of retirement entering Friday's bout, telling ESPN's Ariel Helwani that he "fully expected" to win and had hoped to call out Ryan Bader, who holds Bellator's heavyweight and light heavyweight titles.

Sonnen said the loss convinced him that he has "used up all my toughness."

"I'm not as tough as I used to be," Sonnen said. "I don't want it as bad as I used to. I used to walk through stuff like this."

Sonnen, of West Linn, Oregon, has been one of the most popular fighters in MMA for years. He started to earn mainstream notoriety in 2010, thanks to a heated rivalry with all-time great Anderson Silva. Sonnen challenged Silva for UFC's middleweight championship twice, in 2010 and 2012. He came close to defeating Silva in the first meeting but ultimately lost by triangle armbar in the final round. He lost the rematch by second-round TKO.

Sonnen's ability to promote, and his willingness to face the best of his generation, turned him into a star. His opponents included heavyweight Fedor Emelianenko; light heavyweights Jon Jones, Quinton "Rampage" Jackson, Wanderlei Silva, Tito Ortiz, Rashad Evans, Mauricio "Shogun" Rua and Forrest Griffin; and middleweights Silva and Michael Bisping.

His final opponent was no exception; Machida (26-8) is one of the most accomplished light heavyweights in the sport's history. He won the UFC championship in 2009 and was considered one of the best pound-for-pound fighters in the world. Friday's victory was his 11th career win by knockout.

Sonnen attempted to cut off the ring and use his wrestling to control the bout. He managed to punch his way into the clinch on multiple occasions and did score an early takedown, but Machida remained calm and worked back to his feet.

Later in the opening round, Machida, 41, hurt Sonnen with a right kick to the body. As Sonnen continued to look for forward pressure, Machida dropped him with a flying knee to the chin. Sonnen survived the round, but Machida dropped him again, with a similar knee strike, moments into the second frame.

The bout was officially waved off 22 seconds into the round. The win puts Machida in position to potentially challenge for the light heavyweight belt.

A former collegiate wrestler, Sonnen is considered a pioneer in MMA, but his legacy is not a simple one. Following his first loss to Silva in 2010, he tested positive for elevated levels of testosterone. Three years later, UFC pulled him from a scheduled bout against Vitor Belfort because of a second failed drug test. The Nevada State Athletic Commission suspended Sonnen two years for testing positive for multiple banned substances. Sonnen announced his retirement shortly after but returned to the sport in 2017.

Sonnen's last five bouts all took place in Bellator, where he went 2-3. He was a participant in Bellator's Heavyweight Grand Prix last year, which led to his bout against Emelianenko. During his career, Sonnen suffered seven losses by knockout.