NONE of the so-called great powers leaves Afghanistan smelling of roses. Not Russia, whose ambassador praised the Taliban for their 'positive and businesslike' approach. Not the United States, who decided that now is a good time to abandon the country. Not the United Kingdom, whose Foreign Secretary was taken aback by the speed of the Taliban takeover. (In Mr Raab's case, that's progress. The kind of thing that used to surprise him was that Dover is important for British trade).

Few have emerged with their reputation intact. One has. His name is Laurie Bristow, the British Ambassador to Afghanistan. When everything around him was falling to pieces, he stayed behind, to process visa applications for British and Afghan nationals.

Diplomatic law should (in theory) protect him: this truly is the hour of the Vienna Convention on Diplomatic Relations, the leading treaty in the field. And the convention has rules for exactly this situation: even in armed conflict, the host government must help diplomats who wish to leave the country – for instance, by putting the necessary transport at their disposal. Even when civil war rages, an embassy must be protected, "together with its property and archives".

And yet, the United States deployed thousands of troops in an effort to get their staff out. Smoke rose from the US embassy as sensitive documents were burnt. Joe Biden, it appears, does not have unmitigated trust in the bearded gentlemen with the Kalashnikovs.

These days, one suspects, his mind goes back to the spring of his long senatorial career. The pictures of US helicopters transporting diplomats to the airport evoke memories of Saigon. Saigon, the capital of South Vietnam was in 1975 conquered by forces from the Communist North, marking the end of the Vietnam war. Then, too, US helicopters had been used to help American diplomats leave the country. And then, too, an attempt was made to burn sensitive documents. But some survived the flames, including lists with the names of 30,000 Vietnamese who had helped the United States. It is reported that they were hunted down and killed.

And Biden will think of the Tehran hostage crisis – the seizure in 1979 of the American embassy in Iran by student followers of Khomeini. The parallels are striking. The very word 'Taliban' means 'students'; and in both cases a country has fallen into the hands of religious fanatics. The Tehran crisis saw a failed attempt by US armed forces to rescue the hostages (and a more successful attempt to get six diplomats and consular officers out, disguised as a Canadian film crew).

The crisis also led to a judgment by the International Court of Justice in 1980 which unanimously demanded that Iran 'immediately release each and every one' of the hostages. But the situation would continue for several more months, during which the hostages suffered threats and mistreatment. They were released in January 1981, more than 400 days after the embassy had been taken.

It seems prudent not to put your trust in revolutionaries. To be sure, respect for diplomatic law is in their interest too: sooner or later, they will want to dispatch diplomats of their own, and then they will demand all the rights that seem a luxury at the moment: the protection of embassies, the diplomatic freedom from attack and arrest, the right to travel at will. And then they will learn the lessons of reciprocity: why should we accept your envoys and grant them these rights if you mistreat ours?

For the moment, however, that is an insight that may have escaped the new lords of Kabul. Fanaticism is the most insular of all State ideologies.

And so they celebrate their victory over all Satans great and small, gunfire fills the air, and Hamid Karzai International Airport witnesses scenes of despair and raw humanity. And somewhere in the middle of this, Sir Laurie keeps writing visas.

Here is hoping that international law will be equal to international politics and give him, and those who travel on his visas, effective protection. Here is hoping that the pen, for once, is mightier than the sword.

Dr Paul Behrens teaches international law at the University of Edinburgh.