Hasan Ali Shah, known as Muhammad Hussain al-Hussaini Mahallati was born in Mahallat on 1219/1804, and assumed the Imamate at the age of 13 years in 1233/1817. His most renowned title was Aga Khan. Jafar Rahimtoola writes in "History of the Khojas" (Bombay, 1905, p. 234) that his name was documented with Bombay Government as His Highness Aga Khan Mahallati. His name however in the Bill of 1830 had been written as Pirzada i.e., the son of a saint.
His mother Bibi Sarcar Mata Salamat was the daughter of Pir Mirza Muhammad Bakir. On moving to Yazd, Imam Khalilullah Ali had left his wife and children at Mahallat to live on the proceeds of the family holdings in Mahallat and Kahek. When she found herself insecure in Mahallat, she had gone to Qumm with his son and made necessary arrangement for his elementary schooling, where his tutor was Ali Muhammad Qummi. Hasan Ali Shah, the Aga Khan was a keen scholar in Islamic studies and Sufism was his favourite subject. He had also collected the works of the eminent Sufis of Iran, which he brought in India.