Jim Bouton, a pitcher of modest achievement but a celebrated iconoclast who left a lasting mark on baseball as the author of “Ball Four,” a raunchy, shrewd, irreverent — and best-selling — player’s diary that tainted the game’s wholesome image, died Wednesday at his home in the Berkshires in Massachusetts. He was 80.

He died after a long struggle with vascular dementia, said his wife, Paula Kurman. Bouton had a stroke in 2012 and in 2017 revealed he had a brain disease called cerebral amyloid angiopathy.

When it was published in 1970, “Ball Four,” which reported on the selfishness, dopiness, childishness and mean-spiritedness of young men often lionized for playing a boy’s game very well, was viewed by many readers, approvingly or not, as a scandalous betrayal of the so-called sanctity of the clubhouse.

But the book, which was Bouton’s account of the 1969 baseball season, seven years after his big-league debut with the New York Yankees, had a larger narrative — namely his attempt, at age 30, to salvage a once-promising career by developing the game’s most peculiar and least predictable pitch: the knuckleball.

The pitch, which is optimally delivered with no spin, requires finesse, fingertip strength and a good deal of luck; without spin, the ball is subject to the air currents on the way to the plate, causing it to move erratically, making it difficult for the hitter (not to mention the catcher and the umpire) to track, and just as difficult for the pitcher to control.

In the book, the pitch becomes an apt metaphor for Bouton’s view of himself as an eccentric fellow in a baseball society of conservative go-alongs, stubbornly following his own path and yet dependent on the whimsy of outside forces.

In the 1969 season, Bouton played for an American League expansion team, the Seattle Pilots (now the Milwaukee Brewers), who demoted him for a time to the minor league affiliate in Vancouver and eventually traded him to the Houston Astros, then in the National League. The book, originally published with the subtitle “My Life and Hard Times Throwing the Knuckleball in the Major Leagues,” was, in many ways, a chronicle of the insecurities of an athlete, a one-time star, approaching the end of the line.

“Not only did I have some tenderness in my elbow today, but Sal told me I’ll be pitching in the exhibition game Sunday,” Bouton wrote early in spring training, referring to the Seattle pitching coach, Sal Maglie. “The tenderness will go away, but how am I going to pitch on Sunday? I’m not ready. I haven’t pitched to spots yet. I haven’t thrown any curveballs at all. My fingers aren’t strong enough to throw the knuckleball right. I’ve gone back to taking two baseballs and squeezing them in my hand to try to strengthen my fingers and increase the grip.”

Some astute reviewers recognized the ardor and the poignant tension in Bouton’s tale; in The New Yorker, for instance, Roger Angell described “Ball Four” as “a rare view of a highly complex public profession seen from the innermost inside, along with an even more rewarding inside view of an ironic and courageous mind. And, very likely, the funniest book of the year.”

But for most readers Bouton’s personal predicament was overwhelmed by what he revealed about life in the major leagues.

In Bouton’s telling, players routinely cheated on their wives on road trips, devised intricate plans to peek under women’s skirts or spy on them through hotel windows, spoke in casual vulgarities, drank to excess and swallowed amphetamines as if they were M&Ms.;

Mickey Mantle played hung over and was cruel to children seeking his autograph, he wrote. Carl Yastrzemski was a loafer. Whitey Ford illicitly scuffed or muddied the baseball, and his catcher, Elston Howard, helped him do it. Most coaches were knotheads who dispensed the obvious as wisdom when they weren’t contradicting themselves, and general managers were astonishingly penurious and dishonest in dealing with players over their contracts.

At the time, the reserve clause, a part of every contract that bound players nearly irrevocably to their teams, was still in effect; free agency, which multiplied the earning power of players by many orders of magnitude, was still in the future. Bouton signed a contract with Seattle for $22,000, and his account of the annual petty wrangling over three- and four-figure sums, discomforting at the time, seems incredible today when the major league minimum salary is $555,000 and players are earning an average of more than $4 million a year.

Overall, Bouton portrayed the game — its players, coaches, executives and most of the writers who covered them — as a world of amusing, foible-ridden, puerile conformity. Not surprisingly, the baseball establishment frowned on Bouton, his collaborating editor, Leonard Shecter, and the book.

The commissioner at the time, Bowie Kuhn, called Bouton in for a reprimand; some players shunned him for spilling the beans to players’ wives about what players did on road trips. (Bouton himself was no exception; his first wife, Bobbie, wrote her own book after their divorce.)

A few players, including Elston Howard, claimed Bouton was a liar. And many of an older sportswriting generation felt Bouton had done irreparable damage to the game out of his own self-importance and desperation.

“I feel sorry for Jim Bouton,” Dick Young wrote in the Daily News. “He is a social leper. His collaborator on the book, Leonard Shecter, is a social leper. People like this, embittered people, sit down in their time of deepest rejection and write. They write, oh hell, everybody stinks, everybody but me, and it makes them feel much better.”

In a follow-up book, “I’m Glad You Didn’t Take It Personally,” which was largely about the reaction to “Ball Four,” Bouton thanked Young and Kuhn for stirring the controversy that made the book a success.

And a success it was, even though Bouton wasn’t the first athlete to publish an insider’s account of the professional sporting life. “Instant Replay” a personal chronicle of the 1967 National Football League season by Green Bay Packers guard Jerry Kramer, had preceded it. Bouton wasn’t even the first baseball player to keep and publish a diary; Jim Brosnan, who pitched for four major league teams, published “The Long Season” in 1960.

Still, not only was “Ball Four” an instant and enduring best seller, it also earned widespread recognition as a seminal text of sports literature: In 2002, Sports Illustrated placed it at No. 3 on its list of the top 100 sports books of all time. Perhaps more notable, in 1995, as the New York Public Library celebrated its centennial, it included “Ball Four” as the only sports book among 159 titles in its exhibit “Books of the Century.”

James Alan Bouton was born in Newark, New Jersey, on March 8, 1939, to George Bouton, a business executive who was selling pressure cookers at the time, and the former Trudy Vischer. The family lived in the New Jersey suburbs Rochelle Park and Ridgewood until Jim was in his teens and his father took a job in Chicago.

Jim played American Legion ball — he threw a knuckleball from time to time even then — and graduated from Bloom High School in Chicago Heights, Illinois. He spent a year at Western Michigan University before he was signed by the Yankees in December 1958. He made it to the big leagues in 1962.

It was “Ball Four” that established Bouton’s public reputation as a rebellious flouter of baseball decorum, but he was an odd duck within the game from the beginning. His career had a strange arc. As a Yankee in the early 1960s, he enjoyed brief stardom as a hard-throwing right-hander with a fastball and curveball that he delivered straight overhand, a violent motion that caused him frequently to lose his hat, an idiosyncrasy that became a trademark.

Even as a young player, he had a pugnacious wit and a willingness to speak his liberal mind, most notably to reporters, whom other Yankees made a habit of disdaining, and on subjects like the war in Vietnam, student protests on campus and civil rights, which raised hackles of teammates and Yankees executives.

“After two or three years of playing with guys like Mantle and (Roger) Maris,” Bouton recalled in “I’m Glad You Didn’t Take It Personally,” “I was no longer awed. I started to look at those guys as people and I didn’t like what I saw. They were fine as baseball heroes. As men they were not quite so successful. At the same time I guess I started to rub a lot of people the wrong way. Instead of being a funny rookie, I was a veteran wiseguy. I reached the point where I would argue to support my opinion and that didn’t go down too well either.”

Still, the first three seasons he pitched for Yankees pennant winners, as the team — with stars like Mantle and Maris and Ford — completed a streak of five American League titles in a row.

In 1963 he went 21-7, pitched a scoreless inning in the All-Star Game and, in the World Series, lost a 1-0 decision to Don Drysdale and the Los Angeles Dodgers in Game 3 of the Dodgers’ sweep. In 1964, he was 18-13 and won two games against the St. Louis Cardinals in the World Series (although the Yankees lost that Series, too).

Those were the glory days. Arm trouble bit him after that; he was 4-15 in 1965 as the Yankees slipped to sixth place. And by 1968 he was expendable; the Yankees sold him to the Seattle Angels, then a minor league team that would graduate (as the Pilots) to the big leagues the following year.

In addition to his wife, Bouton, who lived in western Massachusetts, is survived by two sons, Michael and David (who was adopted from Korea as a boy and was called Kyong Jo at the start of “Ball Four”); two stepchildren; and six grandchildren: Alexandria Bouton, Jack Bouton, Georgia Kurman, Annabel Kurman, Skyler van der Hoeven and Aspen van der Hoeven. A daughter, Laurie, was killed in a car crash in 1997.

The notoriety earned by “Ball Four” propelled Bouton to several other episodes in the public eye. For a time he was a sportscaster for network affiliates in New York. He was a delegate from New Jersey for George McGovern at the 1972 Democratic National Convention. He appeared as a crafty killer who gets his comeuppance in Robert Altman’s 1973 sardonic crime drama, “The Long Goodbye,” an updating of the Raymond Chandler novel starring Elliott Gould as Philip Marlowe. And he appeared in a short-lived television series based on “Ball Four” — it lasted just five episodes in 1976.

With Eliot Asinof, best known as the author of “Eight Men Out,” an account of the Black Sox scandal of 1919, Bouton wrote “Strike Zone” (1994), a plot-heavy and melodramatic novel about an umpire on the horns of a moral quandary: He must decide whether to affect the outcome of a game in order to help a man who once saved his life and is now in trouble with gangsters.

Bouton also wrote a book, “Foul Ball” (2005), about his quixotic effort to save an old ballpark in Pittsfield, Massachusetts. That inspired him to help form and promote the Vintage Base Ball Federation, which organizes games played according to 19th century rules by baseball-fan versions of Civil War reenactors.

“Ball Four” was published during the 1970 season while Bouton was with the Astros, but he was having a poor year, and after being demoted to the minors, he retired.

But Bouton wasn’t kidding in “Ball Four” that it was miserable being unable to scratch the competitive itch. So he played semipro ball for several years and, attempting an unlikely comeback, persevered through stints with minor league teams in Durango, Mexico; Knoxville, Tennessee; Savannah, Georgia; and Portland, Oregon, where he became the first investor in Big League Chew, shredded bubble gum in a pouch, in emulation of chewing tobacco, invented by a bullpen-mate, Rob Nelson.

Finally, in September 1978, Ted Turner, then the owner of a then-hapless team, the Atlanta Braves, brought Bouton to his big-league roster, where, at the age of 39, eight years after his first retirement, he started five games and actually won one (he lost three others), pitching six innings and giving up no earned runs against the San Francisco Giants.

He finished his career (finally) with a record of 62-63 and a creditable cumulative ERA of 3.57. By then he had also proved the validity of the final line of “Ball Four,” perhaps the best-known and most resonant sentence in the book, an explanation of why he would put up with the frustration and lunacy he had written about, and a pithy encapsulation of the tug of sport on an athlete.

“You see,” he wrote, “you spend a good deal of your life gripping a baseball, and in the end it turns out that it was the other way around all the time.”

This article originally appeared in The New York Times.