Robert McNamara became a prolific author in later years
Former American secretaries of defence seldom get such widespread obituaries as Robert S McNamara.
Despite a distinguished career which saw him at the centre of power or influence at some of the most troubled times of the 20th Century, it was Errol Morris's 2003 film, The Fog of War, subtitled Eleven Lessons from the Life of Robert McNamara, which singled out this former defence secretary.
In the film, McNamara spoke frankly about the Vietnam war, the Cuban missile crisis and World War II, giving a behind-the-scenes account of the context in which important decisions were taken, in so doing raising questions about the nature of war and human behaviour.
Born in San Francisco in 1916, McNamara graduated from the University of California at Berkeley in economics before gaining an MBA at Harvard.
Cuban Missile Crisis
A brilliant statistician, he was drafted to help develop methods of statistical control for managing the strategic bombing campaigns against Germany and Japan.
He worked with General Curtis LeMay on the firebombing of 67 Japanese cities that killed almost a million people, 100,000 on one night in wooden Tokyo.
In The Fog of War, he agreed with LeMay's assertion that the pair "were behaving as war criminals" and would have been tried as such had their side lost.
In 1946, McNamara was hired by the Ford Motor company to rejuvenate its flagging sales. He rose to become the first president of the company outside the Ford family.
McNamara and Johnson had differences over Vietnam
He was one of the first to introduce safety features in order to reduce the death rate in crashes.
But in 1960, he was snapped up by President John F Kennedy to become his defence secretary.
In this post, he reformed Pentagon practices, oversaw a huge military build-up and was centrally involved in the Cuban Missile Crisis of 1962, when Soviet nuclear missiles were discovered in Cuba and the world teetered on the brink of a nuclear war for 13 days.
In the film, he described Gen LeMay, at that time an adviser to Kennedy, and Fidel Castro, as the two most dangerous personalities of that crisis.
Gen LeMay wanted to attack Cuba unilaterally, while Mr Castro, he said, told him later that he had pressed Soviet leader Nikita Krushchev to attack the United States with nuclear weapons if the US invaded.
During the Vietnam War, McNamara supported US efforts to prevent the victory of Communist insurgents over the government of South Vietnam.
McNamara later described the Vietnam war as "terribly wrong"
To anti-war protesters at the time, McNamara became something of a hate figure, an arrogant ultra-hawk responsible for escalating the war.
He fully supported, Johnson's decision to put ground troops into Vietnam in a bid to prop up the unstable South Vietnamese government and prevent political disintegration which would have aided the Communist cause.
Haunted by Vietnam
By 1966, McNamara had begun to question the wisdom of US involvement in Vietnam and, a year later, was privately advising Johnson to end the war by negotiation.
He initiated a full investigation of the American commitment to Vietnam (later released as the Pentagon Papers). But Johnson escalated the war further by bombing North Vietnam.
McNamara left the job in 1968. The war eventually claimed the lives of three million Vietnamese and 58,000 Americans.
McNamara married for the second time, aged 88
Almost immediately, he took up the presidency of the World Bank where he remained until 1981, focusing on the developing world.
In later years, he became a prolific author and lecturer. His role in the Vietnam War continued to haunt him, though.
It was his memoir, In Retrospect: The Tragedy and Lessons of Vietnam (1995), which inspired The Fog of War movie.
He described the war as "terribly wrong" owing to a combination of the anti-communist climate of the times, mistaken assumptions of foreign policy and military misjudgements.
Critics claimed his admission came 30 years too late.
In 2004, at the age of 88, he married 70-year-old Diana Byfield. It was his second marriage - his first wife Margaret, to whom he was married for 40 years, died of cancer in 1981.
Robert McNamara once said, "I don't believe we should ever apply our power unilaterally. If we can't persuade nations with similar values, we'd better re-examine our reasoning."