Belonging to a relatively wealthy family, Akhundov was born in 1812 in the town of Nukha (present-day
Shaki), which served as the capital of the
Shaki Khanate. A khanate was a type of administrative unit governed by a hereditary or appointed ruler subject to Iranian rule. During the
Russo-Iranian war of 1804–1813, the Shaki Khanate was occupied by the
Russian Empire, who had installed
Jafar Qoli Khan Donboli as their deputy. Akhundov's grandfather, Haji Ahmad, originally lived in
Rasht in northern Iran before relocating to
Tabriz in northwestern Iran. His father Mirza Mohammad-Taqi had previously served as the deputy of the nearby town
Khamaneh, but was dismissed by the
Qajar crown prince of Iran,
Abbas Mirza. Mirza Mohammad-Taqi subsequently became a merchant and relocated to Nukha, where he married Akhundov's mother Na'na Khanum in the same year. Her uncle was Akhund Haji Ali Asghar, a Shia clergyman belonging to the
Moqaddam family of
Maragheh. Akhundov felt a connection to the contemporary Russian poet
Alexander Pushkin, due to his mother's lineage, which included an African ancestor who had served under the Iranian shah (king)
Nader Shah (). In 1813, Iran and Russia agreed to the
Treaty of Gulistan, which resulted in Shaki, along with other territories, coming under Russian rule. The following year, Jafar-Qoli Khan's death led many of the province's inhabitants—who had relied on his support—to migrate elsewhere. In 1814, Akhundov was taken by his parents to Khamaneh. However, Na'na Khanum eventually became dissatisfied with living among the family of Mirza Mohammad-Taqi's first wife, and in 1818, she decided leave Khamaneh, taking Akhundov with her. She went to
Meshgin, where her uncle Haji Ali Asghar resided. This marked the last time Akhundov would see his father. Many years later, Akhundov attacked the idea of men having more than one wife as an evil and corrupting practice that not only oppressed women but also caused permanent animosity and friction between the wives and their children. Akhundov was adopted by Haji Ali Asghar, thus becoming known as "Haji Ali Asgharoglu" or simply "Akhundzade". Haji Ali Asghar was in charge of Akhundov's early education, which included the memorization of the
Quran, teaching of
fiqh (Islamic
jurisprudence) and Arabic and Persian literature. Akhundov first stayed in the village of
Hurand with his mother and Haji Ali Asghar. When Akhundov became seven years old the following year, he was registered in a school. In 1825, Akhundov, his mother and Haji Ali Asghar briefly stayed at Nukha before moving to
Ganja. Some months later, the
Russo-Iranian War of 1826–1828 erupted. in
Ganja, where Akhundov studied and met
Mirza Shafi Vazeh, who steered him from becoming a Islamic clergyman Haji Ali Asghar and his family endured difficulties throughout the war, losing their possessions. Following the conclusion of the war and another Iranian defeat, Haji Ali Asghar and his family relocated to Nukha. There he continued teaching Akhundov Arabic and Persian literature. In 1832, Akhundov was sent to the
Shah Abbas Mosque in Ganja to study logic and Islamic jurisprudence with the Shia theologian Akhund Molla Hossein. This was arranged by Haji Ali Asghar, who wanted Akhundov to become a Islamic clergyman.
Mirza Shafi Vazeh, a mystic, poet, and calligrapher who had been associated with
mystical and
atheistic ideas, was someone Akhundov encountered while studying in Ganja. Initially, Akhundov planned to learn
calligraphy from Mirza Shafi, but their conversations quickly strayed into topics such as Islam, philosophy, mysticism, and the activities of the Shia clergy. Akhundov was adamant on learning Islamic law and jurisprudence in order to become a member of the Shia religious hierarchy, but this changed when he met Mirza Shafi. Akhundov wrote about the impact Mirza Shafi had on him: Haji Ali Asghar disapproved of his Akhundov's new aspirations and had him moved back to Nukha in 1833. Despite this, he still agreed for Akhundov to attend the newly established Russian school there. There Akhundov started learning Russian, but the following year he was forced to stop at the school due to being too old for it. == Later life ==