Ağaoğlu was born in December 1869 to a Shia Muslim family in the town of Shusha, of the Elisabethpol Governorate then controlled by the Russian Empire. His father, Mirza Hassan, was a wealthy cotton farm owner of Qurteli tribe, and his mother, Taze Khanum, was of the seminomadic Sariji Ali tribe.
In 1888, he arrived in Paris and came under the influence of French Orientalists like Ernest Renan and James Darmesteter on Persianocentricism. He was a well-educated person who had graduated from universities in Saint Petersburg and the Paris. He was also a famous journalist and spoke five languages fluently. He wrote articles on current affairs for many popular newspapers in the country and abroad.
He returned to the Caucasus in 1894 and taught French. He then went to Baku to contribute in the formation of a national identity. He wrote monographs in various subjects. It was during that period that he took a different position from the French Orientalists who influenced him and began embracing his Turkish identity.
He considered cultural and educational progress to be the major part for national liberation and viewed the emancipation of women as part of the struggle. Ağaoğlu was the first member of the Azeri national intelligentsia to raise his voice for the equal rights for women. In his book Woman in the Islamic World, published in 1901, he claimed that "without women liberated, there can be no national progress".
Ağaoğlu was chosen from Baku as one of the represents of the Muslims of Trancaucasia and played an important role in prevention of ethnic clashes between Armenians and Azeris in 1905. Along with Nasib-bey Yusifbeyli, Ağaoğlu became a founder of "Difai" (Defender) National Committee in Ganja, which in 1917 merged with the Turkic Party of Federalists and Musavat into a single party.
Fleeing police persecution and possible imprisonment, in late 1908, during the Young Turk revolution in the Ottoman Empire, Ağaoğlu moved to Istanbul. Along with other émigrés from the Russian Empire, like the pan-Turkist writers Yusuf Akçura and Ali bey Huseynzade, he became a key figure in the Turkish movement led by Akçura’s journal Türk Yurdu ("Turkish Homeland") and in the Türk Ocağı ("Turkish Hearth") movement, becoming its president. With increasing influence in the Committee of Union and Progress regime, in late 1915, he became a deputy advocating for the Ottoman Empire to unite all Turkic nations.
Upon the establishment of Azerbaijan Democratic Republic (ADR) in May 1918, Ağaoğlu returned to Azerbaijan. He took up Azerbaijani citizenship, was elected to the Parliament (Milli Mejlis) and was chosen to represent the ADR at the Paris Peace Conference in 1919. The mission was not carried out, however, because of his imprisonment by the British in 1919.
After the Soviet Union took over, Ağaoğlu had to leave the country. He moved to Ankara and continued his journalistic and political activities there, working as the director of the press bureau, the editor-in-chief of the official newspaper, Hâkimiyet-i Milliye ("National Sovereignty"), and as a close adviser of Atatürk. Speaking in support of Westernization and secularization of Turkish society, he wrote in 1928:
If the West is superior in the material then it is due to its totality - its virtues and its vices. The Eastern system is permeated by religion at all levels and this brought decline, while secularization of the West brought superiority. If we want to survive we have to secularize our view of religion, morality, social relations, and law. This is possible only by accepting openly and unconditionally the mind as well as the behavior of the civilization which we are bound to imitate.
Ağaoğlu died in 1939 in Turkey. He was laid to rest at the Feriköy Cememtery in Istanbul.