Sultan Mustafa II was born in Edirne in 1664. His father was Sultan Mehmed IV and his mother was Emetullah Rabia Gulnus Sultan.
After the death of Sultan Ahmed II in 1695, he ascended to the throne at the age of 31 as the eldest of the dynasty. He gave importance to state affairs. During the years he ascended to the throne, the multinational wars that started with the Siege of Vienna in 1683 were continuing at full speed on various fronts. He personally led the army and began to go on campaigns against Belgrade and Austria; he was the last among the Ottoman sultans to go on campaign. In the last campaigns, the Ottoman army was defeated by the Austrians and suffered territorial losses. The Treaty of Karlowitz was signed in 1699. Hungary and Transylvania, which had been under Ottoman rule since 1526, were given to Austria, while Azov was given to the Russians, the Peloponnese to Venice and Podolia to Poland.
These multi-front wars waged on the Polish, Venetian and Russian fronts shook the social and economic structure of the Ottoman Empire. New taxes were imposed for the increasing campaign expenses and the amounts of the existing ones were increased. After a while, serious discontent and rebellions emerged against Mustafa II among both the soldiers, the people and the Ulema (islamic clerics). Thereupon, Mustafa II left the throne to his brother Ahmed III in 1703. He died in Edirne about five months after his dethronement. His body was brought to Istanbul and buried at the feet of his father in the Valide Turhan Sultan mausoleum near Yenicami mosque.
Mustafa II practiced calligraphy, was interested in music, and was skilled especially in archery and javelin.