Tony Gwynn, who won a record-tying eight National League batting championships, amassed 3,141 hits and gained acclaim as one of baseball’s most passionate students of the art of hitting, died Monday in Poway, Calif. He was 54.

Gwynn had undergone surgery for cancer of the mouth and salivary glands in recent years and had been on medical leave since spring as the baseball coach at San Diego State University, his alma mater. He attributed the cancer to having dipped tobacco throughout his career.

Playing all 20 of his major-league seasons with the often lackluster San Diego Padres, in one of baseball’s lesser media markets, and usually shunning home-run swings in favor of well-struck hits, Gwynn wasn’t one of the game’s more charismatic figures. And his pudgy 5-foot-11, 215-pound frame (give or take several pounds) did not evoke streamlined athleticism, even though he was an excellent college-basketball player.

He simply possessed a brilliant consistency with his left-handed batting stroke, compiling a career batting average of .338. The man who wore No. 19 was also a five-time Gold Glove-winning outfielder and an outstanding base stealer before knee injuries took their toll.

Save 75% on a Digital Subscription Today

Gwynn, a 15-time All-Star, entered the Hall of Fame in 2007 after getting 97.6 percent of sportswriters’ votes in his first year of eligibility.

San Diego was in Seattle to play Monday.

The Mariners honored “Mr. Padre” Gwynn with a video tribute and moment of silence before the game. A “19” was painted on the dirt between third base and shortstop — an area Gwynn called the “5.5 hole,” a spot through which many of his hits traveled.

“Obviously, waking up to that kind of news was pretty devastating,” Mariners manager Lloyd McClendon said of Gwynn’s death. “Tony was not only a person that I considered a friend but, as far as hitting was concerned, he was a mentor as well. …

“And to think that we lost him at the age of 54 is really, really tragic.”

Gwynn made his major-league debut in 1982. Two years later, he captured his first batting championship, hitting .351. He also stole 33 bases and struck out a mere 23 times in 606 at-bats, propelling the Padres to the first pennant in their history, though they lost to the Detroit Tigers in the World Series.

Deacon Jones, the Padres’ hitting coach that season, marveled at Gwynn’s bat control.

“He’ll get some funky hits and then he’ll hit a line drive that you could hang three weeks’ wash on,” Jones said. “There isn’t a pitcher in the league who wants Tony Gwynn up with a runner on third base. You know he’ll make contact.”

Gwynn was hitting .394 in the summer of 1994, with a chance to become baseball’s first .400 hitter since Ted Williams batted .406 for the 1941 Boston Red Sox, when a players strike ended the season Aug. 12. He settled for achieving the NL’s highest batting average since Bill Terry hit .401 for the New York Giants in 1930.

Gwynn’s obsession with the elements of a baseball swing began when he played for San Diego State and read Williams’ 1971 book, “The Science of Hitting.” Williams invited Gwynn to talk hitting at his museum in Florida after the 1994 season and suggested he drive the ball more, but Gwynn was reluctant to tamper with his approach.

Gwynn took endless hours of extra batting practice and employed extensive video before that became common in baseball. In his second season he had his wife, Alicia, tape his at-bats off television on trips in hopes of correcting a slump.

“If there are bad at-bats on the tapes, I just click them out,” he told Sports Illustrated in 1995. “You don’t want to watch yourself looking like an idiot, waving at some curveball.”

Gwynn shared the record of eight NL batting championships with Honus Wagner.

Fellow Hall of Famer Greg Maddux tweeted, “Tony Gwynn was the best pure hitter I ever faced! Condolences to his family.”

Seattle Times reporter Adam Jude contributed to this article.