William Patrick Kilmain, 82, a retired Washington attorney who worked for the Justice Department, from 1940 to 1960, died of congestive heart failure Sunday at Suburban Hospital.

Mr. Kilmain came to Washington in the mid-1920s and held clerical posts with the D.C. Parks and Planning Commission and the Veterans Administration while he was attending Catholic University's law school.

After earning his degree in 1931, he engaged in the private practice of law until joining the Justice Department's old Bureau of Immigration and Naturalization in 1940 as a special investigator. He retired from the government in 1960. He then had a private practice for 10 years before retiring a second time in 1970.

Mr. Kilmain had been mayor of Oakmont in Montgomery County for a time in 1960s. He was a resident of Bethesda and a member of the St. Jane de Chatel Catholic Church there. He also was a member of the Rock Creek Council of the Knight of Columbus.

Mr. Kilmain was a native of Wellesley, Mass. He worked for a railroad in Boston and served with the Army during World War I before coming to Washington.

His wife, Edith Davis Kilmain, died in May.

Survivors include a son, William Patrick Jr., of Bethesda; a daughter, Dorothy Kilmain Dosh of Kensington; a sister, Alice Kilmain Fleming of Wellesley; nine grandchildren, and three great-grandchildren.