Tony Gwynn was inducted into the Hall of Fame in 2007. (Chris McGrath / Getty Images)

Tony Gwynn, the San Diego Padres’ Hall of Fame outfielder and one of the greatest hitters ever to play baseball, died Monday after a long battle with cancer.

Major League Baseball and the Padres confirmed that the man known as “Mr. Padre” had died early Monday morning at the age of 54, surrounded by his family at Pomerado Hospital in Poway, Calif. Gwynn had undergone surgery for cancer in a salivary gland and in his cheek, battling for the last four year a disease that he attributed to a lifetime use of smokeless tobacco.

“Major League Baseball today mourns the tragic loss of Tony Gwynn,” Commissioner Bud Selig said in a statement. “The greatest Padre ever and one of the most accomplished hitters that our game has ever known, whose all-around excellence on the field was surpassed by his exuberant personality and genial disposition in life.

“… For more than 30 years, Tony Gwynn was a source of universal goodwill in the national pastime, and he will be deeply missed by the many people he touched.”

Gwynn’s son, Tony Jr., is an outfielder for the Philadelphia Phillies and wrote on Twitter: “Today I lost my Dad, my best friend and my mentor. I’m gonna miss u so much pops. I’m gonna do everything in my power to continue to make u proud! Love u pops!”

Gwynn, a lifetime .338 hitter with 3,141 hits, was eight times the National League’s batting champion. A 15-time All-Star, he was inducted into the Hall of Fame along with Cal Ripken Jr. in 2007.  Most recently, he had been the head baseball coach at San Diego State and last week the school extended his contract for at least one more season, despite health problems that caused him to take a leave of absence in the spring. News of his death was a surprise, coming a day after a poignant interview Tony Gwynn Jr. gave to CSN Philly’s Jim Salisbury for a Father’s Day story.

In recent months, the battle has gotten tougher. Gwynn has tried some new treatments that have sapped his energy and weakened his immune system. In March, he had to take a leave of absence from San Diego State University, where he has been head baseball coach since 2003. The Aztecs went on to win the Mountain West Conference tournament with a Tony Gwynn bobblehead sitting in the dugout taking in all the action. Tony Jr. played one season for his dad in college before being selected by Milwaukee in the 2003 draft. It was a special time for the kid because, after watching his best friend leave on Padres’ road trips all those years, “I got him all year long and it was awesome.”

The last few months have not been awesome.

“This has been the hardest of the four years he’s fought it, by far,” Tony Jr. said.

“When I left for spring training he was in a good spot, and now he’s not in that same spot, so from that standpoint I guess it has worsened. But in the big scheme of things, which is getting healthy so he can do the things he wants to do, I see light at the end of the tunnel. I can’t say that he does, but then again he’s the one going through this, and it’s tough on him.”

As a player, Tony Gwynn exhibited a great joy for the game. He was known for his big smile, his spirit and his enthusiasm almost as much as his sweet left-handed stroke.

It’s tough to hear that this good man, just 54 years old, is going through such a difficult time.

“Imagine what it’s like for a son who’s been with him his whole life and known that same guy off and on the field,” Tony Jr. said. “It’s heartbreaking.”

The Post’s Tom Boswell called Gwynn “one of the sweetest, nicest, smartest players I ever met in baseball,” in his weekly chat today. “He was always grinning, joking and learning. No better student of hitting since Ted Williams. (Some others also [were] great at it, but none better than Gwynn.)”

Boswell recalled pitcher Greg Maddux telling him how difficult it was to assess the speed of a pitch and likened it to the difficulty of telling how fast a car was going. “If the car was alone on the road,” Boswell wrote on his chat, “‘the human eye can’t do it.’ And, Maddux said, ‘No hitter can tell the difference in speed of different pitches, except that &^%$#@! * Tony Gwynn.”

Here’s more from Boswell:

There was no better-loved player — or more worthy of it. Kind of like Brooks Robinson in a previous generation. [Orioles skipper Earl] Weaver said he always preferred “the guys who were loved because they deserved to be loved, like Brooks.”

Today, that will be everybody’s feeling about Gwynn. It was so fitting that he went into the Hall of Fame the same year as Cal Ripken, Jr. It made both of them happy that they could go in together instead of — though they would never say it — with a player who, if you knew everything about them, you wouldn’t like ’em very much.

BTW, Stephen Strasburg was lucky to be under Gwynn’s influence in college. That was a perfect place for Tony, teaching the game he adored — and was a huge FAN or, not just a player — and teaching young people by word and, in his case, by deed. Not some deeds, but just the way he was everyday every time you ever saw him or talked to him. Just a joy. So sorry.

Although Gwynn believed that his cancer was linked to his use of smokeless tobacco, that connection wasn’t proven. Still, Major League Baseball has sought to increase players’ awareness of the dangers of chewing tobacco. The Post’s Adam Kilgore wrote in 2011 of Strasburg’s determination to quit the habit:

For two decades, there has been a fight to educate players on the danger and eradicate smokeless tobacco from baseball, both for the health of players and for the health of children who watch and idolize them. Several congressional hearings, including one last April, have addressed the issue. Major League Baseball has urged players to not use it when on camera. Since 1993, all tobacco products have been banned in the minor leagues on fields, in clubhouses and during team travel. It’s also banned in college and in every significant amateur association.

And yet, experts say, the usage among major league players has remained steady. Roughly 33 percent of major league players, Connolly said, use some form of smokeless tobacco, a rate that has remained stagnant. More dispiriting, its use has risen among young males. The only significant increase of any tobacco product over the last five years, according to Connolly and other advocates, has been the use of smokeless among youths. It has increased to 25 percent, compared with 16 percent of the general population.

Gwynn was a rarity as a pro, passing up larger paychecks in order to remain with the Padres for his entire career. He was born May 9, 1960, in Los Angeles and was a two-sport star as an outfielder and point guard in basketball at San Diego State in the late 1970s-early 1980s. Although he always wanted to play in the NBA, it became clear that his future lay in baseball.

“I had no idea that all the things in my career were going to happen,” he said (via ESPN) before his Hall of Fame induction. “I sure didn’t see it. I just know the good Lord blessed me with ability, blessed me with good eyesight and a good pair of hands, and then I worked at the rest.”

Reaction to news of Gwynn’s passing showed the depth of affection and respect for him.

“This is an extraordinarily sad day,” Ripken wrote on Facebook. “Tony was a Hall of Fame ballplayer but more importantly he was a wonderful man. Tony always had a big smile on his face and was one of the warmest and most genuine people I have ever had the honor of knowing. Like all baseball fans, I will miss him very much and my thoughts are with his family today.”