Khoyski was elected a deputy to the Second Duma of Russian Empire from Elisabethpol Governorate. While delivering a speech before the Duma on 2 February 1907, he criticized the Russian colonization policies in Azerbaijan and the Caucasus. Although he was formally registered with Constitutional Democratic Party (known as the "Kadets"), he also joined the Muslim fraction in Duma. On 27 March, soon after the 1917 February revolution in Russia, Khoyski became a member of the Temporary Executive Committee of Muslim National Councils (MNCs). During the first Musavat summit on 26–31 October 1917, Khoyski spoke in favor of autonomy for Azerbaijan. In December 1917, he was elected a member of the newly created Transcaucasian Sejm and subsequently appointed the Minister of Justice of an independent Transcaucasian Democratic Federative Republic.