The Ansar–Khatmiyya rivalry, also known as al-Mahdi and al-Mirghani rivalry or the Two Sayyids rivalry, was a sectarian division in Sudan that shaped the country's political landscape after the end of the Mahdist State in 1899 and until the Kizan era in 1989.

The rivalry between the Ansar and Khatmiyya sects in Sudan dates back to the 19th century under Turco-Egyptian rule, which saw the rise of politically driven religious movements in Sudan. The Ansar, followers of Muhammad Ahmad al-Mahdi, established the Mahdist State in 1885, which was later overthrown in 1899 by Anglo-Egyptian forces. Meanwhile, the Khatmiyya sect, founded by Mohammed Uthman al-Mirghani al-Khatim in 1817, maintained close ties with Egyptian rulers and received colonial support.

During Sudan's colonial period, the British used both groups to manage the country, but tensions arose due to their differing visions for Sudan's future. The Ansar, led by Sayyid Abdul Rahman al-Mahdi, advocated for "Sudan for the Sudanese" and independence, while the Khatmiyya, led by Sayyid Ali al-Mirghani, supported unity with Egypt under the "Unity of the Nile Valley" slogan. These divisions deepened during Sudan's independence movement, with the Ansar aligning with the Umma Party and the Khatmiyya backing the National Unionist Party (NUP), later the Democratic Unionist Party (DUP).

Post-independence, their rivalry shaped Sudan's political landscape, contributing to political instability, coups, and factionalism. Both groups faced suppression during authoritarian regimes, especially under Gaafar Nimeiry and Omar al-Bashir. Their influence has waned in modern times, with divisions within their political wings limiting their role in Sudanese politics.

History

Ansar and Khatmiyya inception Under the Turco-Egyptian rule, Sudan saw the rise of politically driven religious movements. This was highlighted by the Mahdist Uprising in 1881, led by Muhammad Ahmad "al-Mahdi" against the Turco-Egyptian rule. After liberating Khartoum and killing General Charles Gordon, the Mahdist state was established in 1885. Despite its defeat by British forces in 1899, the movement's influence persisted with its followers known as "Ansar." Ansar were based in Aba Island, and were popular in Darfur (western part of Sudan).

In 1899, after the fall of the Mahdist State, the British government placed restrictions on the movements and activity of the Mahdi's son, Sayyid Abdul Rahman al-Mahdi. However, he soon emerged as the leader of the Ansar. Throughout most of the colonial era of Anglo-Egyptian Sudan, the British government considered him important as a moderate leader of the Mahdists.

In the early 1920s, 5,000 to 15,000 pilgrims came to Aba Island each year to celebrate Ramadan. Many of them identified Abd al-Rahman with the prophet Isa, the Islamic interpretation of Jesus, and assumed that he would drive the white Christian colonists out of Sudan. The British government found that Abd al-Rahman was in correspondence with agents and leaders in Nigeria and Cameroon, predicting the eventual victory of the Mahdists over the Christians. They blamed him for the unrest in these colonies. After pilgrims from West Africa held mass demonstrations on Aba Island in 1924, the Sayyid was told to put a stop to the pilgrimages.

Conversely, during the Turco-Egyptian rule in Sudan, the "Khatmiyya," established by Muhammad Othman al-Mirghani al-Khitmi in 1817, received support and annual endowment from the Turco-Egyptian and British-Egyptian governments. Khatmiyya were based in Kassala, and were popular in the eastern part of Sudan with close ties to Egypt.

Both the Khatmiyya and Ansar received honorary titles and support from the British administration; however, the Ansar leaders resented the Khatmiyya being part of the political landscape in Sudan. Khatmiyya warned that this resentment might lead to civil war.

The struggle for Sudan's independence Following the creation of Graduates' Club, which opened its doors in Omdurman on 18 May 1918 under the supervision of the Gordon Memorial College, politically inclined members sought to expand its role into a platform for nationalist discourse and resistance against the Anglo-Egyptian colonial rule. Discussions at the club often centred on Sudan's political future, fostering debates that eventually led to the formation of two ideological factions with distinct visions for Sudan's path to independence.

The first faction promoted the idea of "Sudan for the Sudanese," inspired by journalist Hussein Sharif. Sharif, through his writings in the newspaper Hadarat Al-Sudan, advocated limited cooperation with the British to modernise Sudan but opposed unity with Egypt, fearing it would undermine Sudanese autonomy. This group, closely allied with Sayyid Abdul Rahman al-Mahdi of the Ansar sect, dominated the club's leadership from 1920 to 1933. For this faction, the Mahdi was portrayed as the first Sudanese nationalist and Abd al-Rahman was to many an attractive leader of the independence movement.

The second faction promoted the idea of "Unity of the Nile Valley" which was supported by unity with Egypt under the Egyptian crown, emphasising cultural and geographical ties between the two nations. Led by Ahmed al-Feel, they rejected alliances with religious sects, despite many members being from families traditionally loyal to the Khatmiyyah sect, and its leader Sayyid Ali al-Mirghani.

The Graduates' General Congress (GGC) was established on 12 February 1938, with 1,180 graduates approving its constitution and electing a 15-member executive committee. Aimed at advocating for Sudanese welfare and independence, the GGC used rallies, media, and alliances to mobilise public support. In 1942, it submitted demands for self-determination and the repeal of restrictive policies, but these were rejected by the colonial government, which denied the Congress political legitimacy. This rejection caused internal divisions between moderates, who sought cooperation, and assertive figures like Ismail al-Azhari, who pushed for politicisation. Al-Azhari's leadership shifted the GGC's focus to broader nationalist goals.

Al-Azhari's influence culminated in the formation of the Ashiqqa (Brothers) party in 1943, advocating for Sudan's autonomy within a united structure with Egypt, which later became the "National Unionist Party (NUP)" in 1952. Al-Azhari's main support came from the Khatmiyya Sufi order. Despite Khatmiyya still receiving an annual British endowment, the British, concerned about Khatmiyyah's growing political influence, have sought to counteract this by bolstering the political position of Abd al-Rahman al-Mahdi.

In August 1944, Sayyid Abdul Rahman al-Mahdi met with senior GGC members and tribal leaders to discuss the formation of a pro-independence political party that was not associated with Mahdism. In February 1945, the National Umma Party had been organised, and the party's first secretary, Abdullah Khalil, applied for a government license. The party's constitution did not mention Sayyid Abdul Rahman al-Mahdi or the Ansar. The only visible link to Abd al-Rahman was the party's reliance on him for funding.

This division among nationalist factions, compounded by historical and ideological tensions, hindered a unified front. Efforts in 1946 to negotiate a common stance on Sudan's future further exposed these rifts, solidifying separate paths for unity with Egypt and full independence. This fragmentation shaped the trajectory of Sudanese political developments for years to come.

The pro-Egyptian NUP boycotted the 1948 Legislative Assembly elections. As a result, pro-independence groups dominated the Legislative Assembly. On 19 October 1952, an agreement was reached between Britain and the Umma-dominated legislature and their allies in a coalition known as the Sudanese Independence Front that was supported by the British since 1947 to act as a bulwark against Egyptian nationalism. This agreement gave the green light for Sudan to achieve self-government by the end of 1952, followed by the exercise of the right to self-determination within the subsequent three years. The legislators then enacted a constitution that provided for a prime minister and council of ministers responsible to a bicameral parliament. The agreement came to be known as the "Gentlemen's Agreement". Later, Colonel Muhammad Naguib, who seized power after the 1952 Egyptian revolution, accepted the right of Sudanese self-determination.

Ismail al-Azhari's pro-Egyptian NUP won the 1953 parliamentary elections and he became the Chief Minister in 1954, he recognised growing public opposition to union with Egypt. In response, al-Azhari shifted the party's stance to support Sudanese independence, advocating for the withdrawal of foreign troops and calling on the Egyptians and the British to sponsor a referendum.

After independence (1956–1969)

On 19 December 1955, shortly after the First Sudanese Civil War had broken out, al-Azhari declared the Independence of Sudan. Internal divisions between the al-Azhari faction and the Khatmiyya order, primarily around al-Azhari's secular policies, led to a split in June 1956, with the Khatmiyya order founding the new People's Democratic Party (PDP), under Ali al-Mirghani's leadership. The Umma and the PDP combined in parliament to bring down the Azhari government, and to preserve their political influence.

Al-Azhari's NUP lost its majority in the 1958 parliamentary election, and with support from the two parties and backing from the Ansar and the Khatmiyyah, Abdallah Khalil put together a coalition government. However, from its inception in 1956, the Umma-PDP coalition could not reach an agreement on a permanent constitution, stabilising the south, encouraging economic development, and improving relations with Egypt. Khalil grew disillusioned with the democratic process due to factionalism and bribery in parliament, coupled with the government's inability to resolve Sudan's many social, political, and economic problems. On 17 November 1958 - the day parliament was to convene - then simultaneously Prime Minister and Minister of Defence Abdallah Khalil (a retired army officer) orchestrated effectively a self-coup against the coalition civilian government, and handing power to General Ibrahim Abboud (the army's Chief of Staff).

The coup removed political decision making from civilian control. Abboud created the Supreme Council of the Armed Forces to rule Sudan. This body contained officers affiliated with the Ansar and the Khatmiyyah. Abboud belonged to the Khatmiyyah, whereas General Ahmad Abd al-Wahab (who helped lead the coup) was a member of the Ansar. Until Abd al Wahab's removal in March 1959, the Ansar were the stronger of the two groups in the government.

Sayyid Abd al-Rahman died on 24 March 1959, and his son, Siddiq al-Mahdi, became imam of the Ansar for the next two years. After Siddiq al-Mahdi died on 2 October 1961, he was succeeded as imam by his brother, Imam al-Hadi al-Mahdi, while Al-Siddiq al-Mahdi's son, Sadiq al-Mahdi, was elected president of the Umma Party in November 1964. On the other hand, Sayyid Ali al-Mirghani died in 1968, leaving his eldest son, Mohamed Osman al-Mirghani to lead the Khatmiyya and PDP. This was dubbed the "divine leadership" by historians.