[2] In the fall of 1905, together with his brother Alakbar, Khasmammadov participated in the establishment of Difai (Defense), a clandestine political association in Ganja.
The group, which also included intellectuals such as Nasib Yusifbeyli, Ismayil Ziyadkhanov, and Ahmed Bey Aghayev, sought to counter the activity of Armenian Revolutionary Federation.
[4] Along with five other Azerbaijani deputies,[5] in November 1911, he spoke in the Duma against a discriminatory practice of exempting Azeris and other Caucasian Muslims from military service in Russian Imperial forces, while levying them with a special tax.
[6] As a member of Musavat Party, he was also closely involved with Azerbaijani national movement for autonomy within Russian Empire.
He was a member of Azerbaijani National Council and one of the co-signers of declaration of independence of Azerbaijan Democratic Republic in Tiflis on May 28, 1918.