A. Bartlett Giamatti, a Renaissance literature scholar and part-time sports writer, was named president of Yale University today, thus ending an agonizing and, at times, embarrassing nine-month drama.

His appointment, announced at a press conference here, makes him, at 39, the youngest president in Yale history, and comes after at least three other candidates had turned down the job, one of the most prestigious in American higher education.

Giamatti is an irreverent English professor and chairman of humanities at Yale, the university's largest and most respected division. He also writes about sports for Harpers magazine.

His name had been mentioned as one of the top candidates for the past four months, but he had repeatedly dismissed those reports, saying, "All I ever wanted to be was president of the American League."

His selection was seen as an effort by the Yale Corp., the university's governing body, to reject pressures to choose a proven administrator or experienced fund-raiser for the post and instead, appoint a scholar who is intimately familiar with the university's problems.

"He does not have line experience as a top level administrator, but we feel it's a quality he has by temperament," said William Bundy, the head of the university's presidential search committee. "He is a very decisive individual." Bundy also said of Giamatti, "he has gone into the jungles and fought with the tigers."

He will become Yale's 18th president at a time when the 276-year-old institution is facing severe financial problems. His most difficult, task, Bundy said, "clearly will be to sustain educational quality in a period of financial retrenchment."

Yale has run up more than $16 million in operating losses the last decade, and expects $7 million more in deficits in coming years. It also has a fund-raising drive, which has brought $253 million, to date but has fallen short of its $370 million goal.

Bundy said the search committee also felt that Giamatti, a witty and articulate speaker, will become a forceful proponent for higher education, a role assumed by his predecessor, Kingman Brewster, one of the nation's most outspoken and controversial universial presidents during his 14 years at Yale.

Giamatti, a leading scholar in medieval and Renaissance literature, has been extremely critical of the permissive direction education has taken in recent years. "Today's college students - the former grammar and high school students of the late 1960s and 1970s - have lost touch with the language," he wrote in a 1976 Washington Post article". . . they arrived at college often completely lost about how to cope with their work, with their time, with themselves."

He was offered the post Sunday during a meeting of the Yale Corp. here after Henry Rosovsky, dean of arts and sciences at Harvard University, rejected the job.

The post had earlier been offered to two other prominent academicians - Donald Kennedy, head of the Food and Drug Administration and a former Stanford University professor, and John Evans, president of the University of Toronto, according to informed sources. Both turned it down.

Giamatti looks like an unlikely Yale president. He is portly, has a goatee and wears rumpled tweed sportscoats on campus. He appeared uncomfortable in a dark gray, pinstripe suit at the press conference announcing his selection. But there were numerous touches of light humor.

"I don't feel like a second choice anymore than Yale should feel like a second choice to the American League," he said.

"For all our good feelings, it's going to be tough," he added, speaking of his presidency. "I'm going to hate some of the things I'll have to do, and people are going to hate me."

His choice is a popular one here. "Giamatti is a considerable scholar and also one of the best teachers in the history of the university," said Harold Bloom, professor of humanities.

Giamatti received both his under graduate and Ph. D. degrees at Yale and has taught at Yale since 1966.

He is the first person of Italian ancestry to become president of Yale. In a recent issue of the Yale Alumni Magazine he wrote good naturedly of a vote for class secretary which found himself and one S.E. Lasewicz the leading vote getters.

"Lazewicz and Giamatti," he wrote. "Wasn't that a bit much? After all, (Tony) Kubek and (Joe) Garagiola are all right for NBC, but for God's sake this is Yale!"