In June 1916 Sharif Hussain, the Hashemite ruler of Mecca revolted against the Ottoman Empire which, under the rule of the Young Turks, had by that time begun movement towards ethnic nationalism and was marginalizing the office of the Caliph. Hussain wanted to move north and create an Arab state from Yemen to Damascus and establish a Hashemite Caliphate. Medina was, at the time, deemed important in that regard and was connected to the Ottoman Empire through a railway line. Hussain's forces besieged Medina, beginning in 1916 and lasting till January 1919. With British support, an initial attack led by Hussein's son Feisal was launched against Medina in October 1916; however, the Arabs were repulsed with heavy losses by the Turks, who were heavily-entrenched and armed with artillery, which the Arabs lacked. As the Arab Revolt slowly spread northwards along the Red Sea, British and Arab strategy for capturing Medina changed, and Faisal and his advisers were determined that the Arabs would gain an advantage by leaving Medina unoccupied; this would force the Turks to retain troops to defend Medina, and to protect the Hejaz Railway, the only means of supplying the city. For this purpose, Nuri as-Said set about creating military training camps in Mecca under the direction of General 'Aziz 'Ali al-Misri. Using a mix of Bedouin volunteers, Arab officers and Arab Ottoman deserters who wanted to join the Arab Revolt, 'Aziz 'Ali created three infantry brigades, a mounted brigade, an engineering unit, and three different artillery groups made up of a patchwork of varying cannon and heavy caliber machine guns. Of his total force of 30,000, 'Aziz 'Ali proposed that it be divided into three armies:
The Eastern Army under the command of Prince Abdullah bin Hussein would be in charge of surrounding Medina from the east.
These armies had a mixture of British and French officers attached to them who provided technical military advice. One of these officers was T. E. Lawrence. The defending commander of the Ottoman garrison in Medina Fahreddin Pasha was besieged by Arab forces but tenaciously he defended the holy city. Fahreddin Pasha not only had to defend Medina but also protect the single-track narrow gauge Hejaz Railway from sabotage attacks by T. E. Lawrence and his Arab forces, on which his entire logistics depended. Turkish garrisons of the isolated small train stations withstood the continuous night attacks and secured the tracks against increasing number of sabotages. With the resignation of the Ottoman Empire from the war with the Armistice of Mudros between Ottoman Empire and Entente on 30 October 1918, it was expected that Fahreddin Pasha would also surrender. He refused and did not surrender even after the end of the war despite pleas from the Ottoman Sultan. He held the city until 72 days after the end of the war. After the Armistice of Moudros the closest Ottoman unit was 1300 km away from Medina. Eventually, his men faced starvation due to a lack of supplies and the remaining garrison including Fahreddin Pasha surrendered on 10 January 1919. Abdullah I of Jordan and his troops entered Medina on 13 January 1919. After the surrender, the Arab troops looted the city for 12 days. Overall 4,850 houses which were locked and put under seal by Fahreddin Pasha were opened forcefully and looted. About 8,000 men of the Turkish garrison were evacuated to Egypt after their surrender. Besides the evacuated some died of disease and others dispersed on their own to various areas. The weapons and ammunition of the garrison were left to the besiegers.