ANAHEIM, Calif. — Shortstop Andrelton Simmons has opted out of the remainder of the Los Angeles Angels’ season.

The Angels announced the four-time Gold Glove-winning shortstop’s decision Tuesday before they faced the San Diego Padres.

Los Angeles (24-31) is still technically in the playoff race with five games left in the regular season, and Simmons clearly caught the Angels by surprise, although the club said it respected his decision.

The 31-year-old Simmons, who can be a free agent this winter, is finishing his fifth year with the Angels. After spraining his ankle in late July and missing 22 games, Simmons is currently batting .297 with 10 RBIs while playing his usual stellar defense, albeit with four errors in 30 games.

“At this time, I feel this is the best decision for me and my family,” Simmons said in a statement. “We don’t know what the future holds, but we would like to sincerely thank the Angels organization and Angels fans for welcoming and making us feel at home.”

Manager Joe Maddon acknowledged he was caught by surprise when general manager Billy Eppler told him about Simmons’ decision Monday night after Simmons went 1 for 4 with an RBI single in the Angels’ home finale. Maddon texted Simmons, but hadn’t heard back by Tuesday afternoon.

“I’ve really enjoyed this guy a lot,” Maddon said. “I’m a big fan. This guy is a good baseball player, and I’ve enjoyed the conversations, too. It’s just unfortunate. He’s really a big part of what we’re doing right now.”

Simmons is a favorite of Angels fans for his defensive wizardry, and owner Arte Moreno has described Simmons as perhaps his favorite player to watch on the roster. Simmons has batted .281 with 36 homers and 281 RBIs during his five seasons with Los Angeles, and he won the Gold Glove in 2017 and 2018.

“He’s a thinking kind of a player, and I’ve enjoyed him a lot,” Maddon said.

Simmons will be a free agent this winter, and the Angels have an obvious replacement for him in David Fletcher, who has a .374 on-base percentage while regularly hitting leadoff for the Angels during his breakout major league season. Fletcher has been playing second base since Simmons’ return from injury.

But the Angels haven’t publicly closed the door on Simmons’ return, and he could be given a qualifying offer. Maddon has repeatedly said he would like Simmons to return in 2021 if possible.

The Angels haven’t had a winning season during Simmons’ five years in Anaheim, although Simmons said last week he wasn’t discouraged by the lack of team success. Simmons played his first four major league seasons in Atlanta, and he hasn’t appeared in the postseason since 2013.

Simmons also said he hadn’t been involved in any recent contract talks with the Angels, but he had enjoyed playing for the club. When asked if he wanted to return to the Halos, Simmons said he would have to “plead the fifth.”