Eugene L. Roberts Jr. yesterday announced his resignation as president and executive editor of the Philadelphia Inquirer, the newspaper he built in 18 years from a second-rate, second-place daily into one of the nation's strongest papers.

In an emotional announcement, Roberts, 58, told a shocked newsroom staff that after a three-month transition he plans to teach, write, travel and serve as a consultant to the Knight-Ridder newspaper chain, which owns the Inquirer. Among the teaching jobs he is discussing is a tenured post at the University of Maryland College of Journalism.

Roberts said he first considered retiring three years ago, and was dissuaded by Knight-Ridder management. "Now," he told his staff, "the time has come." Roberts will be succeeded by Maxwell E.P. King, a senior vice president who has served the Inquirer in both marketing and editorial positions since 1972. He will hold the titles of editor and executive vice president.

Also promoted yesterday were Managing Editor Gene Foreman, to executive editor; and Deputy Managing Editor James M. Naughton, to managing editor.

Inquirer employees were quick to suspect that Roberts threw in the towel because of recent cost-cutting pressures from the parent company. "It's no secret that there's been a struggle over money and corporate power between Gene Roberts and Miami," said one staff writer. "And we've all felt the reverberations of that struggle one way or another." In recent months, the space allotted to news has been trimmed back by six columns in the daily paper, and 12 columns -- the equivalent of a full two pages of articles -- on Sundays.

Roberts, however, denied the cutbacks were a factor in his decision. Cuts made this year, he said in a telephone interview, "did not hit an artery... . I think restraint has been shown" by Knight-Ridder in an era when newspaper revenues are dropping everywhere. "It's unquestionably better to be an editor in good economic times, but some of that comes with the turf... . Basically I made the decision last year."

The Inquirer, with a daily circulation of about 500,000 and a Sunday audience of about 1 million, is the jewel in the Knight-Ridder crown. On coming to the paper in 1972, Roberts inherited a demoralized, shoddy paper, and built it into a consistent Pulitzer Prize winner (17 in his 18 years) that delved deeply into local government and gave reporters the time and freedom to conduct intensive investigations. After 1982, when the Philadelphia Bulletin folded, the Inquirer's near-monopoly status made it a major cash cow for Knight-Ridder.

Roberts's peers and reporters yesterday spoke of an era's passing. Bill Kovach, curator of the Nieman Foundation, said, "I don't think there's a community in the country whose newspaper readers have the access to the amount of information about their government that people do in Philadelphia... . Gene Roberts or persons like him were the kind of people that Jefferson and Madison and George Mason had in mind when they carved out the role of journalists in a self-governing society."

Reporters described themselves as "shocked," "stunned," "flabbergasted" by the resignation. Rumors began to circulate yesterday morning and were confirmed at an early afternoon staff meeting, which Roberts entered to an extended standing ovation. Some staff members cried as he read his decision from a prepared statement, and at several points Roberts's voice was choked with emotion. Naughton, the Inquirer's new managing editor, said, "There are lots of folks seeking reassurance, and getting it, that what's really intact here and going to continue is a deep commitment to the values that Gene Roberts represented and so deeply embedded in our newsroom."

King said in an interview that Knight-Ridder, in promoting him, Naughton and Foreman, was "trying to send a very strong signal, because each of those three men grew up under Gene and developed under Gene. And each of us is a disciple of Gene Roberts." King acknowledged in meetings with staffers yesterday that Roberts seemed "battered" lately. In an interview, he elaborated. "He's fought long and hard for good journalism, against all sorts of different pressures, and he's fought hard, and he's fought well, and he's battered in the sense of being tired. I wish he'd stay for 10 more years, or even 20, and I'd love it if he would, but he deserves a rest."

University of Maryland College of Journalism Dean Reese Cleghorn said the school was "talking seriously" with Roberts about a tenured position. Roberts, who has been on the college's board of visitors for the past seven years, said that he is traveling to College Park later this week for further discussion, but that he is also considering other offers.

"Mainly, at the moment," he said, "I want to travel until I get bored with hotel rooms and things."