Ali Shah. Hasan Ali Shah was on a hunting trip at the time, but he sent a messenger to request permission of the monarch to go to Mecca for the hajj pilgrimage. Permission was given, and Hasan Ali Shah's mother and a few relatives were sent to Najaf and other holy cities in Iraq in which the shrines of his ancestors, the Shiite Imams are found. Prior to leaving Mahallat, Hasan Ali Shah equipped himself with letters appointing him to the governorship of Kerman. Accompanied by his brothers, nephews and other relatives, as well as many followers, he left for Yazd, where he intended to meet some of his local followers. Hasan Ali Shah sent the documents reinstating him to the position of governor of Kerman to Bahman Mirza Baha al-Dawla, the governor of Yazd. Bahman Mirza offered Hasan Ali Shah lodging in the city, but Hasan Ali Shah declined, indicating that he wished to visit his followers living around Yazd. Hajji Mirza Aqasi sent a messenger to Bahman Mirza to inform him of the spuriousness of Hasan Ali Shah's documents and a battle between Bahman Mīrzā and Hasan Ali Shah broke out in which Bahman Mirza was defeated. Other minor battles were won by Hasan Ali Shah before he arrived in Shahr-e Babak, which he intended to use as his base for capturing Kerman. At the time of his arrival in Shahr-e Babak, a formal local governor was engaged in a campaign to drive out the Afghans from the city's citadel, and Hasan Ali Shah joined him in forcing the Afghans to surrender. Soon after March 1841, Hasan Ali Shah set out for Kerman. He managed to defeat a government force consisting of 4,000 men near Dashtab, and continued to win a number of victories before stopping at Bam for a time. Soon, a government force of 24,000 men forced Hasan Ali Shah to flee from Bam to Rigan on the border of Baluchistan, where he suffered a decisive defeat. Hasan Ali Shah decided to escape to Afghanistan, accompanied by his brothers and many soldiers and servants. Afghanistan Fleeing Iran, Hasan Ali Shah arrived in Kandahar, Afghanistan in 1841 – a town that had been occupied by an Anglo-Indian army in 1839 in the First Anglo-Afghan War. A close relationship developed between Hasan Ali Shah and the British, which coincided with the final years of the First Anglo-Afghan War