With the end of World War I, most of the Ottoman Empire came to be occupied by the Allied Forces. This caused much resentment among the Turks and sparked nationalist sentiments. The Turkish forces led by Mustafa Kemal fought the Greek, French and Armenian troops (supported by other Allies). By the end of the Turkish War of Independence, the Treaties of Kars (1921) and Lausanne (1923) were signed and this paved the way for the establishment of the Republic of Turkey in October 1923. The Ottoman Caliphate was abolished the following year.
The end of World War I in 1919 brought about major political and geographic changes on the world map. The Ottoman Empire surrendered to the Allied Forces with the signing of the Armistice of Mudros on October 30, 1918. Hostilities in the Middle Eastern theatre ended the next day. The Allies were quick to occupy parts of Anatolia thus starting the erosion of the empire. In November 1918, French troops entered Constantinople and occupied the city.
The Ottoman Turks took the path of least resistance when the Allies first occupied parts of Anatolia. The Treaty of Sèvres signed in August 1920, however, came as a big blow to Turkish nationalistic sentiments. The treaty allowed for the Greek occupation of the east, along the Aegean Sea. The French and British administrations took over the south parts of the Ottoman Empire. Armenia was carved out of the north east and despite being Turkish and Kurdish territory most of the region was under French, Italian, and British control. The Turks lost control over many major cities including Antalya, Konva, Afyon, Canakkale, Istanbul, Sivas, Diyabakir, and Adana. There was widespread resentment against the Caliph and the Royal Family of the Ottoman Turks for ceding these lands to the Allies and retaining a nominal representation.
Anti-Greek sentiments had been simmering since the start of the Greek campaign of Western Anatolia in May 1919. This was the time when hundreds of unarmed Turkish soldiers and civilians were killed by Greek troops. The Greeks moved from Smyrna and occupied cities like Selcuk. The initial skirmishes between the Greeks and the Turks in 1920 were inconclusive but by 1921, the nationalist cause had gained much support, which translated into the rise of the Turkish armed resistance.
On April 23, 1920, Grand National Assembly made up of delegates from across the empire met in Ankara and elected Mustafa Kemal Atatürk, a highly successful Turkish military general and a revolutionary nationalist as the Chairman of the Assembly. Mustafa Kemal provided the nationalist movement a very inspired leadership. He rejected the treaty of Sèvres and established a provisional government in Ankara in 1921. Mustafa Kemal and the Turkish National Movement were now fighting the Allied occupation in three fronts – the Greeks to the west, the French to the south, and Armenia to the east. This year saw much military success for the Turks against the Greeks. In the meanwhile, the Soviet Union decided to help the Turkish nationalist resistance due to its interests in Armenia and supplied them troops and arms. The Turkish victory over Armenia came with the occupation of the Kars region. This victory freed up the Turks to concentrate on the west and confront the Greeks. The Allied forces at this point were reluctant to interfere on behalf of the Greeks who had to leave Thrace. The French withdrew from Anatolia and the British Parliament did not back another war. It is only after the Greek left Constantinople that peace talks finally began.
The Treaty of Lausanne was signed in July 1923 to replace the Treaty of Sevres. Not only did it secure independence for Turkey, it also defined the Turkish borders which remain nearly the same till date. On October 29, 1923, the Republic of Turkey was established and the following year the Ottoman Caliphate was officially abolished.