Edward Geary Lansdale, 79, a retired Air Force major general who spent most of his career as a counterinsurgency specialist in the Philippines and South Vietnam, where he developed the doctrine that communism could best be defeated by "winning the hearts and minds of the people," died of a heart ailment Feb. 23 at his home in McLean.

Gen. Lansdale was an influential and often controversial figure who helped shape U.S. policy in Southeast Asia at critical junctures during the 1950s and 1960s. He was an assistant for special operations to secretary of defense Robert S. McNamara during the early years of the Kennedy administration when vital decisions were being made to commit U.S. support to the Saigon government in fighting the Viet Cong in South Vietnam.

As special adviser to the Philippines defense minister, Ramon Magsaysay, he directed the successful campaign against the communist-led Hukbalalhap guerrillas during the early 1950s.

As a U.S. adviser in South Vietnam in the years immediately after the French defeat at Dien Bien Phu in 1954, Gen. Lansdale directed operations, many of them covert, that installed and maintained President Ngo Dinh Diem in office.

He was the prototype for Col. Edwin Barnum Hillendale in "The Ugly American," the novel by William J. Lederer and Eugene Burdick about a harmonica-playing American officer who went into the rural areas of the Philippines and persuaded the peasants to oppose communism.

He also was the prototype for "The Quiet American," the naive U.S. official in the novel by Graham Greene who believed the United States could defeat communism in South Vietnam by instilling a sense of Town Hall democracy in the rural population.

He was unassuming almost to the point of self-effacement, and he sometimes was criticized as a dreamer. Frances FitzGerald described him in her 1972 best-seller on Vietnam, "Fire in the Lake," as a man of "artless sincerity who never thought in terms of systems or larger social forces."

But Gen. Lansdale also attracted a corps of supporters who regarded him as nearly infallible. He was a staunch advocate of the principle that communism "will not die by being ignored, bombed or smothered by us." It could best be challenged, he said, "by a better idea."

He was an early proponent of psychological warfare, a concept he first put to use against the Hukbalalhap in the Philippines. In one such operation there, government psychological warfare squads, playing on a superstitious dread of vampires in the countryside, spread rumors that a vampire lived on a hill where the Hukbalalhap were based.

Two nights later, the govern-ment squad seized the last man from a night rebel patrol, punctured his neck with two holes, hung his body until the blood drained out, and then put the corpse back on the trail. The insurgents fled the region.

As an adviser to Diem in the 1955 referendum to choose between Diem and the dissolute Emperor Bao Dai as head of state in South Vietnam, Gen. Lansdale suggested having the ballots colored in ways that could influence the voting. Diem's ballots were printed in red, the color many Vietnamese considered to be good luck, while those for Bao Dai were a shade of green that to many Vietnamese signified a cuckold. Diem won with 98 percent of the vote.

Born in Detroit, Gen. Lansdale was a graduate of the University of California at Los Angeles. He was an advertising executive on the West Coast before World War II.

During the war, he served in the Office of Strategic Services, the predecessor of the Central Intelligence Agency. He transferred to the Air Force when it became a separate service in 1947. In most of his assignments in Southeast Asia, however, he reported to the CIA.

From 1950 to 1954, he was assigned in the Philippines. After the election of Magsaysay as president, he went to South Vietnam as head of the Saigon Military Mission and as an adviser to Diem. He was directed specifically by Secretary of State John Foster Dulles to assist in "counterguerrilla training."

From 1957 until the end of the Eisenhower administration, Gen. Lansdale was assigned at the Office of the Secretary of Defense, returning to Vietnam on a temporary mission shortly before the inauguration of John F. Kennedy as president in January 1961.

His report calling for a U.S. team in Vietnam staffed by a "hard core of experienced Americans who know and really like Asians" and for increased use of CIA-backed covert operations caught the attention of the president.

But by this time, Gen. Lansdale had opponents in the State Department and was not invited to participate in any of the operations. In 1962, he worked briefly on an abortive White House plan aimed at getting rid of Cuban President Fidel Castro, then retired from the military in 1963.

He returned to South Vietnam in 1965 as an assistant to Ambassador Henry Cabot Lodge and later to Ambassador Ellsworth Bunker. He left Saigon in 1968.

Gen. Lansdale received two Distinguished Service Medals for work in developing counterinsurgency tactics in Vietnam and for services as adviser to Magsaysay in the Philippines.

His first wife, the former Helen Batcheller, died in 1972.

Survivors include his wife Patrocinio Yapcinco Lansdale of McLean; two sons by his first marriage, Ed-ward Russell Lansdale of New York City and Peter Carroll Lansdale of Oakton, Va., and five grandchildren.