The control of this strategic position brought him in contact with the British army during the First Anglo-Afghan War (1839-42), where he was able to render vital assistance. As governor of Peshawar, Avitabile controlled the southern entrance to the Khyber Pass, although the Maharaja did not allow for the British to move through the Sikh Empire to reach the Khyber pass, he ordered Avitable to assist the British through the pass itself, into Afghanistan. During Elphinstone's advance in 1839, the British were well received in Peshawar and their officers received a princely treatment. Captain Havelock spent a month in Peshawar, and describes the splendour of Avitabile's court in his memoirs. He also gives a favourable characterisation of the governor: He is, moreover, a frank, gay, and good-humoured person, as well as an excellent and skilful officer.