NEW YORK — Jimmy Piersall, a former Major League Baseball player known for his playful antics and the mental health struggles that became the subject of a book and movie, has died at age 87, the Boston Red Sox said on Sunday.

Piersall, who battled back from a mental breakdown early in his career to become a two-time All Star, died on Saturday at a care facility in Wheaton, Illinois, said the organization where he played eight of his 17 big-league seasons.

In his first full season with the Red Sox in 1952, Piersall quickly became known as a clown for his pranks and on-field gestures that included imitating revered veterans of the game, according to the Society for American Baseball Research, or SABR.

But after his antics turned to fisticuffs with opposing players and teammates alike, Piersall was sent back to the minors, where his behavior grew worse, SABR said. He was eventually diagnosed with manic depression, as bipolar disorder was known in the 1950s, and hospitalized, it said.

Piersall wrote about his battle with mental illness in his 1955 book, “Fear Strikes Out,” with Al Hirshberg. A 1957 movie based on the story featured Anthony Perkins as Piersall and Karl Malden as his father.

Piersall returned to the Red Sox lineup in 1953 as an outfielder and stayed with the team until 1958. He continued playing until 1967 for the Cleveland Indians, Washington Senators, New York Mets and Los Angeles Angels.

In all, he batted .272 with 104 home runs and 591 runs batted in. He was picked for the American League All-Star team in 1954 and 1956.

He continued his somewhat more subdued antics, including some that poked fun at his condition. When he hit his 100th career home run with the Mets on June 23, 1963, he turned backwards to run the bases.

James Anthony Piersall was born on Nov. 14, 1929, in Waterbury, Connecticut, a factory town 90 miles from New York where most baseball fans rooted for the Yankees. Piersall grew up a Red Sox fan and was steered into professional baseball by his father.

After his playing days, he worked as a broadcaster for the Texas Rangers in 1974 and the Chicago White Sox from 1977 to 1981.

His survivors include his third wife, Jan, and nine children from his first marriage.