Michael Williams at Chatham House, in London, last year. ‘He was the UN at its best: humility, integrity, wisdom,’ said Jean-Marie Guéhenno, the former head of UN peacekeeping.
Photograph: Rex/Shutterstock

Michael Williams, Lord Williams of Baglan, who has died aged 67 after suffering from cancer, was a senior United Nations diplomat with a knack for turning the organisation’s principles into action on the ground, most successfully in the aftermath of the 2006 war between Israel and the Lebanese militia, Hezbollah. Williams’s work in Lebanon between 2006 and 2011 was the culmination of his role as an effective, if largely unsung, troubleshooter for the UN, in locations from Cambodia to the former Yugoslavia and the Middle East.

The six-week conflict had left large parts of Lebanon in ruins, but the Israelis felt they had failed to win a convincing victory. As for the Hezbollah fighters, they proclaimed themselves victors merely for surviving the Israeli onslaught. Inside Lebanon, the political situation was more than usually explosive following the 2005 assassination of the former prime minister Rafik Hariri, which the UN had promised to investigate.

Williams understood that a semblance of peace on the border would arise through a balance of deterrence between Israel and Hezbollah, and only the UN could broker this, since the US and British governments ban their diplomats from any contact with the group. Despite its 30-year history of violence and terrorism, Hezbollah had to be acknowledged as a key influence on the Lebanese government.

As a UN official, Williams had the unique freedom to cross the border at will, acting as both bridge and barrier between the Israeli army and Hezbollah. He gained the confidence of the Hezbollah security chief Hajj Wafiq Safa, who appears to have enjoyed the diplomat’s sense of humour. “Each side was eager to learn my assessment of the other,” he wrote later. Safa “would interrupt me impatiently to establish if a view I expressed reflected my own opinions or those of the Israelis”.

In the end, he established “rudimentary confidence” between the enemies, allowing the resolution of the fate of the two Israeli soldiers whose kidnap in a cross-border raid sparked the war, and permitting an exchange of prisoners. The understandings reached at that time have made the border more stable than at any time since the 1970s. Thanks to Williams’s personal touch, he managed to maintain the respect of all parties in Lebanon despite his engagement with Hezbollah. Jean-Marie Guéhenno, former head of UN peacekeeping, said of Williams: “He was the UN at its best: humility, integrity, wisdom.”

Michael was born in Bridgend, south Wales, the son of Emlyn Williams, a steelmaker, and his wife Mildred (nee Morgan), and went to Sandfields comprehensive in Port Talbot. A voracious reader as a child, he gained a degree in international relations at University College London in 1971 and went on to do a master’s degree and doctorate at Soas, with a thesis on Islam and politics in Indonesia.

His break into the international civil service came in 1992 when the UN set about rebuilding Cambodia after the ruinous legacy of the Vietnam war. The UN needed someone to run a radio station to explain to the Cambodians what the 20,000-strong mission was doing. Knowledgable about south-east Asia and having worked for the BBC World Service and Amnesty International, Williams was a perfect fit.

The job went well and he was sent to the former Yugoslavia, as spokesman for the UN Protection Force (Unprofor). This was a far tougher assignment. Unprofor was a woefully under-resourced outfit viewed by much of the foreign press corps as too feeble to take on the Serbs. In the Goražde crisis of 1994, Williams struggled to control an angry crowd of journalists baying for military action against the Serbs in eastern Bosnia. But in months to come, as one of the reporters recalled, he gained their respect through his mastery of the strategic leak.

From these beginnings, Williams, a Welsh Labour party member, moved to Whitehall in 2000 as special adviser to the foreign secretary, Robin Cook. When Tony Blair moved Cook from the post in 2001, his successor, Jack Straw, kept Williams on, despite the politicians’ very different temperaments and approaches. He later served as Middle East adviser to a third foreign secretary, David Miliband.

His experience on the frontline and in policymaking won Williams a series of Middle Eastern posts at the UN in New York which led to his appointment in 2008 as special co-ordinator for Lebanon with the title of under-secretary-general. His speedy ascent raised eyebrows at UN headquarters, but he proved his ability to do business with Israeli generals and warlords of every stripe in Lebanon.

In 2010 he entered the House of Lords as a Labour peer, but became a crossbencher to meet the impartiality requirement of his appointment in 2011 as international trustee on the BBC Trust.

In December last year, after moving to the Cotswolds from Steyning, West Sussex, to avoid the disruptions on Southern Rail, he suffered from back pain and stomach upsets. In February he was diagnosed with pancreatic cancer and, despite his rapidly deteriorating health, continued to travel to London to Chatham House, the policy research centre where from 2011 he was a distinguished fellow, and attend debates in the Lords.

He is survived by his second wife, Isobelle Jaques, whom he married in 1992, and their son, Ben, and by a daughter, Rhiannon, from his first marriage, to Margaret Rigby, which ended in divorce.