A few months ago a group of friends were  discussing the reasons for Partition when one of them said that the  Khilafat Movement was the starting point of Pan-Islamism which made  Muslims believe or reiterate that they constituted a separate nation. 
The article tells you about this movement, was  written in March 2001 and edited in May 2017. It is based on inputs  from The History and Culture of Indian People by the Bharitya Vidya  Bhavan and the Tragic Story of Partition by H.V. Seshadri. 
Article has five parts namely - 
1. Events in Turkey that gives you a background  	to Khilafat. 
2. The Khilafat movement. 
3. The non-cooperation movement is referred to  	briefly since it has its origin in the Khilafat movement. 
4. The Moplah rebellion in Kerala is a result of  	the Khilafat movement.
5. Hindu-Muslim unity! 
Events in Turkey 
An attempt was made towards inaugurating a  Pan-Islamic movement i.e. the Aligarh movement during the last  quarter of the 19th century. It did not succeed but the  sentiment never died out altogether. It is proved by the active  sympathy of the Indian Muslims  towards the Turks in their fight  against Italy and the Balkhan powers. Turkey’s entry into the war  as an ally of Germany put Indian Muslims into a quandary. Their  natural sympathy lie with the Sultan of Turkey as their Caliph or  religious head but as British subjects they were to be loyal to the  British throne. 
Realizing their predicament the British PM, Lloyd  George declared on 05/01/1918, that the allies “were not fighting  to deprive Turkey of the rich and renowned lands of Asia Minor and  Thrace which are predominantly Turkish in race”. These assurances  led the Indian Muslims to believe that whatever happened, the  territorial integrity and independence of Turkey, so far as her  Asiatic dominions would be maintained. 
However, what happened was different. Thrace was  presented to Greece while the Asiatic portions of Turkey passed to  England and France. Thus, Turkey was dispossessed of her homelands  and the Sultan deprived of all real authority. Indian Muslims  regarded this as a great betrayal and carried on agitations through  out 1919 but to no effect.
At the same time Mustufa Kemal Pasha, a highly  gifted leader rose in Turkey brushed aside the weak regime of the  Caliph and resolved to make a new, powerful Turkey on modern  nationalistic lines. Aware that the Caliph was the religious leader  of the Arab world he decided to get rid his country of Arabism and  liberate it from the stronghold of the maulvis and mullahs. He was  helped by Jamaluddin Afghani, an Arab born in Afghanistan in 1838.
The rise of a powerful state in Turkey did not  suit the Brits. They prodded Aga Khan to join hands with the Caliph.  Aga Khan and Amir Ali went to Kemal Pasha and begged him to save the  Caliph. Abdul Majid. Kemal treated them with contempt and derided Aga  Khan (a Shia) and Amir Ali (a Khoja) as heretics of Islam who had no  business to advise the Sunni Turkish Muslims. 
Kemal said that it was ironical that two men who  were the pillars of the British rule in India had come to advise  Turkey on their national policy. He exposed these two men, dethroned  Islam from the pedestal of the official state religion and  transformed Turkey into a secular state.
But the Khilafat leaders in India would not give  up. Under the leadership of the Ali brothers they approached King  Abdul Azeez of Arabia to become the new Caliph. The King had the  Indians in a corner by asking them “If it is Islam that you are  zealous about, why do you not join hands with Gandhi and free India  of British rule. That’s what Islam teaches. You come to me as a  slave of the Brits and it seems to me that you have come to lead me  into a British trap”. Next the leaders approached Reza Shah, the  ruler of Iran. But Shah proud of his Aryan tradition, evinced little  interest. 
In 1921, Muhammad Ali wrote a letter to the Amir  of Afghanistan inviting him to invade India. The Brits got scent of  this and arrested the Ali brothers. On his written assurance that he  was no opponent of the Brits he was released. 
In 1921, when the Khilafat agitation was at its  peak, Ali again sent a wire to the Amir urging him not to enter into  any agreement with the Brits. When Ali was taken to task by the  Congress leaders he showed Swami Shraddananada (renowned Arya Samaj  leader) a hand written draft of the wire. The Swami writes “What  was my astonishment when I saw the draft of the same self-same  telegram in the peculiar handwriting of the Father of the non-violent  non-cooperation movement”. 
Writing in the Young India in May 1921 Gandhi  said, “I would, in a sense, certainly assist the Amir of  Afghanistan if he waged war against the British govt. It is no part  of the duty of a non-violent non-cooperator to assist the govt  against war made upon it by others. I would rather see India  perish at the hands of the Afghans than purchase freedom from  Afghan invasion at the cost of her honor. To have India defended by  an unrepentant govt that keeps the Khilafat and Punjab wounds still  bleeding is to sell India’s honor”. Gandhi was criticized by Lala  Lajpat Rai and B C Pal for his statements. 
It is interesting to note that the Hindu Congress  leaders took up the case of the Caliph when the Muslim world itself  had refused to do so.