Gwynn, whose sweet left-handed swing has put him in the company of baseball greats like Honus Wagner and Ted Williams, said Thursday that he'll retire at the end of the season.

He knew all along that 20 seasons with the San Diego Padres was going to be enough. He just had to find the right time to say so.

Gwynn wanted to delay the announcement as long as possible because didn't want the fanfare of a farewell tour. But he's been injured most of the year and finally got tired of answering questions about his future. And he figured the fans should have a chance to say goodbye, too.

''I've had a great time. It's been a wonderful experience,'' Gwynn said. ''But I'm not dying today. People have been talking about like I have nothing else to offer. I love baseball; I've played this game for a long time and I've had a ball, but it's just time to start thinking about doing something else.

That, of course, is the baseball coaching job as his alma mater, San Diego State, which will open next June. It was on May 29, when Gwynn told reporters that he covets the Aztecs' job, that it became clear this would be the last season for the player who's arguably the greatest pure hitter of his generation.

Gwynn's immediate goal is to get healthy and get back on the active roster. He's played only 16 games, batting .333. The hard part will be September and the end of the career of the greatest sports hero in San Diego history.

Even as Gwynn spoke to a packed news conference, fans were lining up to buy tickets to what will be, barring further injury, Gwynn's last home game on Sept. 23, against San Francisco.

''The clock is ticking,'' Gwynn said. ''I've got three months. I'm going to try everything in my power to get back out there.''

Gwynn will retire at the same time as baseball's Iron Man, Cal Ripken Jr., who will have spent 21 seasons with Baltimore.

''One of my secret goals was to get to 20 seasons, and this one obviously got me there,'' Gwynn said.

Gwynn said he originally wanted to retire at the end of 2000, but he wanted to redeem himself after being limited to a career-low 36 games after undergoing his sixth surgery on his left knee.

But then he strained his right hamstring on April 20. He came off the disabled list on May 8, but the next night -- his 41st birthday -- he hurt it again and has been out ever since.

''Obviously it hasn't gone the way I wanted it to go the last couple of years, but all in all, I think I did OK,'' he said. ''I think I did all right.''

Gwynn said he was happy that he was able to play so consistently for so long. He won eight NL batting titles and is 16th on the all-time hits list with 3,124.

''I'm happy I played 20 years, I played them all here in San Diego,'' he said. ''So the back of my bubblegum card from here to eternity will look pretty good, I think.''

Because of his injury history, the Padres put Gwynn through the wringer in negotiating a one-year deal last winter, after he had filed for free agency for the first time.

But now it will be tough to say goodbye.

''You have to start preparing yourself for life without No. 19,'' general manager Kevin Towers said. ''It's scary.

''I'll be missing that infections smile, every day you walk through the clubhouse, regardless if he had a good day or a bad day; watching him work with younger players; praying for his spot to come up in the order in the ninth inning with runners on second and third against a tough closer.''

The Padres will be losing their greatest selling point.

''You can go to a foreign country and I imagine if you said, 'San Diego Padres,' they might say, 'Tony Gwynn.' That may be all they know about San Diego,'' Towers said.

Team president Larry Lucchino said Gwynn has been one of the best role models in recent baseball history.

''I hope that we can honor his contributions and his legacy half as well as he honored it today,'' Lucchino said.

Gwynn said he'd go to the All-Star Game if the NL asks him to, but he doesn't want to go if it means a more-deserving player gets knocked off the roster.

And then, in September, will come his final at-bat.

If Gwynn could script it, he'd like to hit a ball to his favorite ''5.5 hole'' between third base and shortstop.

''Then you round first and smile and say, 'That's how it started, it might as well end that way. Chances are it will probably be a lazy fly ball to left field because I chicken-wing it and get my elbow up and it'd end that way,'' he said to laughter. ''But either way it goes, it's been great.''

Gwynn has a lifetime .338 average. Hall of Famer Ted Williams, a San Diego native, hit .344, the only player in baseball with a higher batting average than Gwynn since World War II.

Last season, Gwynn hit above .300 for the 18th straight season, breaking Honus Wagner's NL record. With his eighth and final batting title in 1997, Gwynn tied Wagner for the most in the NL.

Gwynn's best year was 1994, when he was batting .394 when the players' strike began. It was the highest in the majors since Williams batted .406 in 1941.

Gwynn got his 3,000th hit on Aug. 6, 1999, at Montreal.

He reached the World Series twice, but the Padres lost to the Detroit Tigers in 1984 and the New York Yankees in 1998. One of his career highlights was homering off the upper-deck facade in Yankee Stadium in Game 1 of the '98 Series.