Charlie Wilson, former US congressman, died overnight near his home in east Texas, at the age of 76.

Wilson spent 24 years in the house of representatives, but even so his name would hardly ring a bell with many readers were it not for the 2007 film Charlie Wilson’s War, which dramatised his role in promoting US support for the anti-Soviet resistance in Afghanistan in the 1980s.

Films always take liberties with the truth, and it probably suited Hollywood’s politics to focus on Wilson, a Democrat, rather than the Republican administration of the time. But it seems as if Wilson really was the larger-than-life figure that the film portrayed: notorious as a heavy drinker and womaniser, sometimes impetuous and wrong-headed, but passionate about the causes he supported and highly effective in building political support for them.

In the short term, the war that Wilson supported was strikingly successful: armed with American money and weaponry, the Afghan resistance tied down a large Soviet occupying force, and eventually secured Soviet withdrawal in 1989. It was one of the defining moments of the end of the Cold War, just as the fall of Saigon 14 years earlier had marked the high point of Soviet power.

But the backwash has been awful. The Soviet-backed government gave way not to a peaceful and democratic Afghanistan but to an endless civil war between shifting alliances of extremist factions. In 2001, the then Taliban government’s support for al-Qaeda drew the US back into the war, this time with troops on the ground against the fundamentalists (later joined by Australia among others), and in due course it got bogged down in much the same way that the Soviets had.

The analogies with Vietnam don’t stop there. In neither case was the war really about the welfare of the country concerned: even in the 1980s it was reasonably clear that the Afghans were better off under Soviet rule than under any likely alternative, and the American-backed governments in South Vietnam, although corrupt and authoritarian, were vastly preferable to what succeeded them.

But even strategically there wasn’t very much at stake. Although there was occasional talk about using it as a springboard to warm-water ports in Baluchistan, Afghanistan was never really any use to the Soviets, and America had plenty of other bases in south-east Asia. The Soviets ended up using Vietnam more as a counter to the Chinese than to the US.

In each case, the war was really about prestige. America was deeply traumatised by defeat in Vietnam, and the drive to strike a similar blow at the Soviets fed its support for the Afghan fundamentalists. The result was blood and chaos in Afghanistan but also, indirectly, the fall of the Soviet empire and freedom for many millions in eastern Europe.

Charlie Wilson could claim a share of the credit for both.