In February 1979, Cuéllar was appointed as United Nations Under-Secretary-General for Special Political Affairs.
From April 1981, while still holding this post, he acted as the Secretary-General's Personal Representative on the situation relating to Afghanistan.
In that capacity, he visited Pakistan and Afghanistan in April and August of that year in order to continue the negotiations initiated by the Secretary-General some months earlier.
During his two terms, he led mediations between Britain and Argentina in the aftermath of the Falklands War and promoted the efforts of the Contadora Group to bring peace and stability to Central America.
He also interceded in the negotiations for the independence of Namibia, the conflict in Western Sahara between Morocco and the Polisario Front, and the Cyprus issue.