James E. Flannery, 85, a former official of the Central Intelligence Agency, died of complications of lung cancer June 15 at a hospice in Sun City, Ariz., where he lived for the past five years.

Mr. Flannery, who was born in San Antonio, served in the Army in World War II. After landing on Utah Beach in Normandy in June 1944, he fought his way across France and into Germany as a company commander in the 79th Infantry Division.

On Nov. 19, 1944, when his unit was pinned down in woods near the French town of Hattigny, Mr. Flannery crawled to within 20 yards of German lines, then crawled back to his troops to plan an attack. Under cover of darkness, he led three platoons to positions within 30 yards of enemy forces before leading the nighttime raid. Despite being outnumbered, his unit drove the German battalion from the field, killing 33.

For his bravery and leadership, Mr. Flannery was awarded the Silver Star. He also received two awards of the Bronze Star. He retired as a lieutenant colonel in the Army Reserve in the 1960s.

After the war, he was assigned to the United Nations Relief and Rehabilitation Administration in occupied Germany, helping resettle refugees. He continued to work in Europe as a civilian employee of the United Nations in 1946-47.

While in Czechoslovakia, he met his future bride. By dressing her in a spare Army uniform and helmet, he was able to smuggle her across borders to safety. They were married in Germany in 1947.

Mr. Flannery moved to Washington in 1948 to attend the Georgetown University School of Foreign Service, from which he graduated in 1951. He worked in the office of Rep. Olin E. Teague (D-Tex.), who had been his commanding officer in the Army.

During the Korean War, Mr. Flannery was recalled to active duty and assigned to the CIA. He joined the CIA permanently in 1952 and served in Japan. In the late 1950s, he worked at CIA headquarters in Langley as an assistant to Richard Bissell, who developed the U-2 spy plane.

In the 1960s, Mr. Flannery was assigned to La Paz, Bolivia, and Mexico City. He was chief of the CIA mission in Santo Domingo, Dominican Republic, from 1965 to 1969. In later years, he was deputy chief of the Latin American division.

After his retirement in 1974, Mr. Flannery was co-founder of what is now the Association of Former Intelligence Officers.

He moved to Elizabeth City, N.C., in 1975 and moved to Arizona in 2000.

Survivors include his wife of 58 years, Herta Flannery of Sun City; four children, James E. Flannery Jr. of Pembroke Pines, Fla., Heidi Flannery of San Antonio, Shannon Soltis of Naples, Fla., and Patrick Flannery of Phoenix; one sister; and nine grandchildren.