The Los Angeles Angels made the stunning announcement Thursday that they are releasing Albert Pujols, an almost certain Hall of Famer who was in the final year of the 10-year, $240 million contract he signed ahead of the 2012 season.

Pujols, 41, has appeared in 24 of 29 games at first base and designated hitter for the last-place Angels this season and has hit five home runs. He is hitting .198 with a .250 on-base percentage and .372 slugging percentage, which would be career lows for the 21-year major league veteran, 2001 rookie of the year and three-time MVP.

“The Angels Organization proudly signed Albert Pujols in 2011, and are honored that he has worn an Angels jersey for nearly half of his Hall-of-Fame Career,” Angels owner Arte Moreno said in a team-issued statement. “Albert’s historical accomplishments, both on and off the field, serve as an inspiration to athletes everywhere, and his actions define what it means to be a true Superstar. Since his Rookie of the Year Season in 2001, Albert and his wife Deidre have generously given their time and resources to countless charities throughout the world. We are thankful to the entire Pujols Family.”

That the Angels would release one of the generation’s most prolific hitters in early May, just months before his contract expired, was somewhat of a surprise. It seemed as if the Angels would just carry the veteran for the rest of the year, grateful for his clubhouse presence, then let him head ceremoniously into retirement.

Perry Minasian, the Angels’ first-year general manager, said Thursday he had been mulling the idea of releasing the veteran for some time, but was finally convinced to do so by the strong season-opening performances of Shohei Ohtani and Jared Walsh, who would play ahead of Pujols at designated hitter and first base, respectively. Pujols told Angels executives that he intends to keep playing and will try to find work elsewhere.

“There was no fight. There was no argument. This was a conversation that went back and forth. He expressed his feelings; we expressed ours,” Minasian said. “He understood where we stood on the whole situation, and things did not end bad. I gave him a big hug.”

The Los Angeles Times reported that Pujols was kept out of the Angels’ lineup against Tampa Bay Rays left-hander Ryan Yarbrough on Wednesday night even though he was 6 for 9 with two home runs, two doubles and seven RBI over his career against him and suggested that Pujols’s frustration about not being in the lineup may have contributed to the decision to cut ties now.

Manager Joe Maddon admitted he had talked to Pujols about the decision to sit him. Maddon said he had told Pujols he would be playing all week but changed his mind.

“He came to me. We had the conversation. He knew exactly where I was standing on the entire situation, and so what happened last night happened,” Maddon said Thursday. “But there was no tipping point.”

A career .298 hitter whose consistent swing was the envy of many a major league hitter, Pujols ranks fifth on the MLB career list with 667 home runs, trailing fourth-place Alex Rodriguez by 29, and 14th on the all-time hits list with 3,253 (only two behind Eddie Murray). His 2,112 career RBI rank third behind Hank Aaron and Babe Ruth, and Pujols and Aaron are the only major league players to collect 3,000 hits, 600 home runs and 600 doubles over their careers.

His best years, however, were in St. Louis, where Pujols took home all of his season-ending awards, appeared in nine All-Star Games and led the Cardinals to seven playoff appearances and two World Series titles between 2001 and 2011. After signing his mammoth contract with the Angels in December 2011, Pujols put up solid numbers but appeared in only one All-Star Game, never finished higher than 17th in the MVP voting and appeared in the postseason only once, a 3-0 American League Division Series sweep by the Kansas City Royals in 2014 in which Pujols hit only .167.

This season, the 27-year-old Walsh — Pujols’s designated successor at first base for the Angels — has put up better numbers, though the team has attempted to keep both in the lineup by often putting Walsh in right field instead of first base. With Pujols no longer on the team, Walsh can return full time to his natural position.

Pujols said before this season that he did not know whether he planned to retire when his contract was up after this season. In February, his wife seemingly announced that this would be his final season when she wrote on Instagram, “Today is the first day of the last season of one of the most remarkable careers in sports!” But she later edited that comment to say, “Today is the first day of the last season (based on his contract) of one of the most remarkable careers in sports!”