Dwight E. Avis, 81, who retired in 1964 as director of the Alcohol and Tobacco Tax Division of the Internal Revenue Service after 38 years as a government investigator and administrator, died of kidney failure Sept. 12 at a hospital in Boca Raton, Fla. He lived in Boca Raton.

Mr. Avis began his government career in 1926 with the old Bureau of Internal Revenue. He became an agent and inspector with the Justice Department's old prohibition bureau and then returned to Treasury. He was named director of the Alcohol and Tobacco Tax Division in 1951.

During his career, Mr. Avis saw the evolution of liquor production from an illegal business operated by moonshiners and rumrunners during Prohibition to a major American corporate enterprise. His office contained symbols of this change, a model of a typical moonshine still and a picture of what was then the world's biggest distillery, the Hiram Walker operation in Peoria, Ill. But the early days were the ones he used to tell about to newspaper reporters.

In a 1964 interview with The Washington Post he told what it was like to take on the Purple Gang in Detroit, Legs Diamond and Dutch Schultz in New York, and the Capone mob in Chicago.

He recalled a Sunday in Chicago during the 1920s when he led a raid on 30 stills. The following morning, the man who had "squealed" to the revenue agents was murdered on a busy street corner.

"We were always dealing with situations like that," Mr. Avis said.

Among the men he supervised in those days was the famous federal gangbuster Elliot Ness.

Mr. Avis's later years were as important as the early ones were exciting. He weathered the change from an agency that had put the emphasis on suppression of illegal stills to work with legitimate liquor producers. At the time he retired, he was working on the revamping of federal statutes on liquor and tobacco. Perhaps one measure of Mr. Avis's success is that during his 13 years as its chief his division collected $62.5 billion.

Mr. Avis was born in Iowa, graduated from the University of Iowa and earned a law degree at Drake University. He moved to Washington in 1930 and retired to Asheville, N.C., in 1964. He moved to Florida later in the 1960s.

Survivors include his wife, the former Margaret Coggins, of Boca Raton; a son, Dwight E. Jr., of Vienna; a daughter, Nancy Phipps, of Reston; a stepson, Walter Thomas Rowland III, of Atlanta, and seven grandchildren.