William S. Burroughs, 83, the grandson of the inventor of the adding machine who, through his wildly iconoclastic writing and way of life, became known as one of the founding fathers of the Beat Generation, died yesterday evening in Kansas.

Burroughs died in the intensive care unit of Lawrence Memorial Hospital in Lawrence, a nursing supervisor said. The Associated Press said he had been admitted a day earlier after a heart attack.

With Jack Kerouac and Allen Ginsberg, Burroughs was known as one of the three major creators and exemplars of the Beat Generation's literature and lifestyle. He was a leader in a movement that shaped and reflected the great transition between the staid 1950s and the chaotic '60s.

Although perhaps not so well known as either Kerouac or Ginsberg, both of whom died before him, Burroughs was widely recognized as the author of such path-breaking works as "The Naked Lunch" (1959), described as a surrealistic and horrifying yet hilarious recounting of the author's experiences as a drug addict.

Initially, Burroughs seemed destined to a life of utmost respectability. The grandson and namesake of a prominent inventor, he was born in an elite section of St. Louis, attended private schools there and graduated from Harvard University in 1936 with a bachelor's degree in English.

But after moving to New York, he took such jobs as bartender, private detective, exterminator and newspaper reporter. He also became addicted to drugs.

In one of the most significant incidents in his life, he accidentally shot and killed his wife in Mexico in 1951, after a day of drugs and drinking.

In a 1982 biography, he said that event forced him to become a serious writer. He said it brought him "in contact with the invader, the Ugly Spirit, and maneuvered me into a lifelong struggle, in which I have had no choice except to write my way out."

After living in London during the 1970s, he moved to Kansas in 1981, where he branched out into more conventional literary forms, practiced the visual arts and wrote screenplays.