Thom Gunn, the British-born poet who made San Francisco his home for 40 years, and wrote poems that combined mastery of form with a contemporary frankness and subject matter, died Sunday night in San Francisco. He was 74.

Mr. Gunn died in his sleep at home and was discovered at 9 p.m., said his partner of 52 years, Mike Kitay. "I'm thinking it was probably a heart attack, " Kitay said, "but the medical examiner won't know the cause of death for weeks."

Members of the literary community reacted yesterday with shock at Mr. Gunn's sudden death. "I thought he was possibly the best living poet in English," said Wendy Lesser, an author and editor of the literary journal the Threepenny Review. "Unlike most poets, he was equally at home in rhyme and non- rhyme, in free verse and patterned rhythms. He had a quiet, modest, almost impersonal voice as a poet, but every poem he wrote was recognizably his -- and his poems about death, particularly about deaths from AIDS, are masterpieces."

Robert Pinsky, a former U.S. poet laureate and professor at Boston University, e-mailed his thoughts on Mr. Gunn from Berlin: "His poems attain a cool clarity, an ability to be morally discerning but not judgmental; amused but engaged." By doing so, Pinsky said, they "reflect the man's generosity of spirit; his wickedly funny but forgiving skepticism about literary fashions and blowhard academic critics; his kind acceptance of many kinds of people."

"There was a special quality that had to do with the underside of life," said poet Philip Levine. "The characters who walked through Thom's poems -- they were everybody. He had such an affinity for the odd man out, the non- belonger, the despised, the downtrodden. He had this sympathy and insight, and he really humanized these people and made them loveable in his poems."

Vital and spry and endlessly youthful, "looking less like a retired professor than an emeritus rock-star" as a local critic wrote, Mr. Gunn was an enthusiastic advocate of his adopted city and shared a shingled home in Cole Valley that he bought in 1971 with a $3,300 down payment.

From 1958 to 1966 and from 1973 to 1990 he taught at UC Berkeley, commuting by bus. But he gave up a tenured position because he couldn't bear to attend department meetings.

Mr. Gunn was the recipient of many literary awards -- the Forward Prize, England's largest poetry prize, in 1992; a $369,000 MacArthur Fellowship for lifetime achievement in poetry, in 1993; and last year the prestigious David Cohen British Literature Prize -- but he assiduously rejected the stuffy attitudes and behaviors of academia.

In spirit, Kitay said, he remained an "outlaw." He wore leather when he lectured at Cal, identified with biker culture (and briefly owned a motorcycle), tried LSD, wrote poems extolling the gay bathhouse culture of the '70s and was an avid fan of "The Simpsons," "NYPD Blue" and "Friends." He disliked snob-constructed divisions separating "high culture" from "low culture."

"He was always proud, as I was, that we would go hear the Grateful Dead play in Golden Gate Park. We loved all that," said Kitay. He was a displaced Englishman "of decorous, skillful, metrical verse," wrote the young English poet Glyn Maxwell, "who had for his own reasons become absorbed into an alien culture that gave him alien subjects (like sex), alien backdrops (like sunshine) and, most vexing of all, made his forms melt on the page."

Mr. Gunn was born in Gravesend, England, on Aug. 29, 1929. His father, Herbert, was a Scottish merchant seaman who became a journalist. His mother, Ann Charlotte, also a journalist, was an independent spirit who encouraged Mr. Gunn's writing.

In an interview, Mr. Gunn said his parents divorced when he was 8 or 9. His mother, to whom he was close, committed suicide when he was 15. He and his younger brother, Ander, found the body, but Mr. Gunn wasn't able to write about it until 1992, in the poem "The Gas-poker."

Forty-eight years ago

-- Can it be forty-eight

Since then? -- they forced the door

Which she had barricaded

With a full bureau's weight

Lest anyone find, as they did,

What she had blocked it for.

Mr. Gunn studied at Trinity College, Cambridge, graduating in 1953. He was an early success, recognized by the critical press as part of "The Movement," a group of poets including Philip Larkin, Kinglsey Amis and Donald Davie. He was 25 when his first book, "Fighting Terms," was published.

Instead of staying on in England and reaping the rewards of early acclaim, Mr. Gunn moved to California soon after "Fighting Terms" was published in order to be with Kitay, an American he had met at Cambridge. For decades, Kitay remained frequent inspiration for Mr. Gunn's work, such as the love poems "Thoughts on Unpacking," "The Separation," "Touch" and "Hug." In a later poem, "In Trust," Mr. Gunn reflected on the couple's abiding bond, lasting through frequent separations:

As you began

You'll end the year with me.

We'll hug each other while we can.

Work or stray while we must.

Nothing is, or will ever be,

Mine, I suppose. No one can hold a heart,

But what we hold in trust

We do hold, even apart.

"He wrote often about San Francisco," said Lesser, "about homeless people he had seen on the street, or the beauty of landscape, or what it felt like to be a taxi driver in the city, even though he himself didn't know how to drive."

Mr. Gunn also wrote about his unconventional communal household: For years he and Kitay shared their home with close friends Bill Schuessler and Bob Bair. Another member of the acquired family, Jim Lay, died of AIDS in 1986. Mr. Gunn was HIV-negative.

"He loved his household and the fact that we ate together," Kitay said. "People were always astonished that we each had our own cooking nights."

"He had a terrific sense of humor," said Levine, whose association with Mr. Gunn dates back to Stanford University in the '60s. "He was a very pleasant guy to be with. Very physical, demonstrative."

"He was a lovely person, always interesting and fun," Lesser said. "A great gossip, but a bit taken aback by his own ability to make nasty comments, so that he was always modifying them with kinder remarks. He had an excellent memory and could remember, for instance, the names of the characters in the books his mother read him when he was a child.

"I will remember him as a dear friend who shaped my life in literature," she said, "and who made me understand how decent and satisfying and un- careerist the writing life could be."

Mr. Gunn is survived by Kitay; his brother, Ander, a photographer; an aunt, Catherine, who helped raise him after his mother's death; a niece, Charlotte; a nephew, Will; a grandniece, Emma; and a grandnephew, Joe.