 He served as the Foreign secretary— the leading bureaucratic position in Pakistan Government— in 1973 until 1977, after Zulfikar Ali Bhutto's government was dismissed (see Codename "Fair Play").However, he immediately served as the foreign policy adviser to upcoming Chief Martial Law Administrator General Zia-ul-Haq who appointed him as the Foreign Minister shortly after assuming the control of the country.In 1982, after losing General Zia's favour when he made an attempt to keep country on Non-Aligned Movement membership, he lost the foreign affairs ministry to senior military officer Lieutenant-General Yakob Ali Khan.