The siege of Medina lasted from 10 June 1916 to 10 January 1919, when Hejazi Arab rebels surrounded the Islamic holy city, which was then under the control of the Ottoman Empire.
The second holiest city in Islam was then guarded by an Ottoman battalion led by Fahreddin Pasha, who resisted for two years and seven months, a persistent defense that lasted even after the war had ended.
In November 1914, British diplomats made contact with Sharif Hussain of Mecca, which would then be a two-year dialogue also known as the McMahon–Hussein Correspondence.
With increasing fears that Ottomans were clamping down on subversive Arab nationalists, Sharif Hussain staged a region-wide revolt in June 1916.
The prime objectives of the initial revolt was to deprive the Ottomans of any legitimacy to the title of Caliphate by capturing the two holy cities of Mecca and Medina.
Once Mecca is captured, the Arabs turned their attention to Medina, which was defended by an even bigger Ottoman force complemented by the strategic Hejaz Railway.
For this purpose, Nuri as-Said set about creating military training camps in Mecca under the direction of General 'Aziz 'Ali al-Misri.