The British diplomat Sir Robin Fearn, who has died aged 71, became head of the South America department of the Foreign Office in 1979, where one of his responsibilities was to guide ministers through the protracted negotiations with Argentina over the future of the Falkland Islands. By the time he finished his stint in 1982, he had shown extraordinary qualities of organisation, leadership and character, and earned the respect of both political masters and colleagues. The Falklands crisis tested him, but did not find him wanting.

For a man whose postings took him to three Spanish-speaking countries, it seems fitting that Fearn should have been born in Barcelona, where his father managed the local office of a British company. After the family returned to Yorkshire, he was sent to school at Ratcliffe college, did his national service in the Intelligence Corps, where he learned Russian, and went to University College, Oxford, to read modern languages. His first job was with the Dunlop Rubber Company, covering Venezuela and parts of the Caribbean.

Contrary to the legend that diplomats were never sent to places they knew anything about, Fearn's first job on joining the Diplomatic Service in 1961 was in Caracas. Postings followed to Budapest (1966-68), Vientiane (1972-74) and Islamabad (1976-79), interspersed with spells in London. Despite the limitations imposed on a British diplomat in cold war days, he came to love Hungary and contrived to form friendships, against all odds. In Vientiane, where the Indochina war waged a little less fiercely, Fearn's ambassador was Alan Davidson (obituary, December 4 2003), later famous for his cookery books.

On one occasion, a huge Mekong catfish was caught and, as tradition required, was offered to the king of Laos, who, in turn, arranged a special banquet to eat the rare delicacy. Davidson wrote about the culinary aspect, but it fell to Fearn to make urgent arrangements so that the head and skeleton could be airlifted to the Natural History Museum in London before they rotted.

In Pakistan, as head of chancery, he showed his skills at dealing with people at all levels, both inside and outside the embassy. The political tensions of the period, which included the Soviet invasion of neighbouring Afghanistan, helped sharpen his ability at political analysis.

The Argentinian invasion of the Falklands in April 1982 brought ministerial resignations, and press howls for the heads of those who had not foreseen events in the south Atlantic. Fearn refused to be frightened, and faced the deluge of critics with calm and steadiness. It was, none the less, a relief when the subsequent Franks committee report, which reviewed government decisions in the run-up to the Falklands war, laid no blame at his door.

From the moment of the invasion, it fell to Fearn to organise and animate - indeed, almost to invent - the emergency unit which had to manage intra-Whitehall coordination as well as to seek international support for the UK's response. He worked almost without pause for weeks on end, but remained calm, reassuring and approachable, encouraging his team by his own example as they shouldered a huge burden of work.

His unstinting efforts earned him the chance to go to the Royal College of Defence Studies for a sabbatical year in 1983, where he wrote a thesis on the Antarctic treaty and made many new friends. Having recharged his batteries, he was sent to Havana as ambassador to Cuba in 1984. With Britain being seen as a friend of the United States, and the US as the number one enemy of Cuba, the room for building bridges was severely limited. All Fearn could do was to encourage British business to compete for the modest contracts that the Cuban state trading agencies put out to offer when they had hard currency. This he did with zest, and earned plaudits from British business. His essential decency and kindness were invaluable in sustaining staff morale in a place which was then, unlike today, remote in the sense that links with the outside world, whether by air or telephone, were few, slow and expensive.

On his return to London in 1986, Fearn became assistant undersecretary responsible for relations with the Americas. It was a wide remit covering the entire western hemisphere, though much of his effort went into fighting internal battles to defend the British presence in smaller countries in the face of pressure for budgetary savings.

In 1989, Fearn was named as ambassador to Spain, an appointment which greatly delighted him. Spain was already modernising fast, on the back of EU membership, and British business was begining to invest seriously. With vanishing frontiers, cheaper flights and growing prosperity, millions of British tourists visited the country, and significant numbers of them decided to buy homes and spend at least some of their lives under Spanish skies.

There was an obvious opportunity to forge a closer relationship with a country that, like the UK, had an international outreach through its history, language and culture. Gibraltar, the "stone in the shoe", effectively blocked that opportunity. None the less, Fearn found himself looking after many high-level visitors from the UK when, in 1992, resurgent Spain staged the highly succesful Olympics in Barcelona and the Seville Expo. He and his wife Sally, whom he had married in 1961, were able to build a wide network of friends, both Spanish and British, from the mighty to the humble.

After his retirement in 1994, Fearn became director of the Oxford University foreign service programme, effectively teaching diplomats from many countries. He enjoyed the chance to pass on the benefits of his experience, and when that ended in 1999 he took on another teaching post, as associate head of the Centre for Political and Diplomatic Studies, in Oxford. He took to this new role like a duck to water, and his gentle enthusiasm communicated itself to students.

Apart from this main employment, Fearn was asked to take on numerous other tasks. He chaired the Anglo-Spanish Society for three years and became chair of the governors of King's College schools in Madrid. He was an active member of the council of the University of Bath (conveniently close to the village of Gastard, which he so much loved and where he happily took on the role of jobbing gardener and handyman). From 2001, he was a trustee at the Imperial War Museum, where his common sense was greatly valued. His musical interests were channelled through the development board of the early music choir, the Sixteen, where conductor Harry Christophers found him a sound counsellor.

This picture shows a man of wide activity, but fails to record his personal energy. In Spain, Fearn was reputed to have walked most of the long-distance footpaths in the Guadarrama and Gredos mountains. He was a competitive participant at any sporting activity, and his friends will not think it incongruous that he should have died on a tennis court. Throughout Fearn's career, Sally was a constant companion. She survives him as do his daughter, three sons, and four grandchildren.

· Patrick Robin Fearn, diplomat, born September 5 1934; died August 26 2006.