A former grand mufti of Egypt has predicted Qatar will be destroyed within two years, using a bizarre historical reference as proof and comparing modern Qataris to an early Islamic sect that was massacred by its rivals.

Ali Gomaa told an audience in Cairo on Wednesday that the UAE would be victorious in the Gulf crisis, and compared the people of Qatar to the "Khawarij" - a taboo name for "traitors" who embraced violence and caused havoc among early Islamic civilisation.

Egypt's former grand mufti predicts the 'extermination' of Qatar... pic.twitter.com/XuIfXcnpx4 — Middle East Eye (@MiddleEastEye) June 29, 2017

Gomaa claimed the "Khawarij", led by an ancestor of the modern Qatari royal family, was exterminated 1,000 years ago by a tribe now in control of the UAE - and predicted the same would happen again.

His claims come as Qatar is facing open hostility and a blockade from Saudi Arabia, the UAE, Bahrain and Egypt, which demand Doha changes its foreign policy, stops "supporting terrorism" and shuts down the Al Jazeera media organisation.

"Qutri ibn Fujaa was the imam of the Khawarij and it was after him that Qatar was named," said Gomaa, adding that the royal Qatari family al-Thani were his descendants.

According to Gomaa, Qutri was defeated by an "Emirati man" called Muhalab ibn Sufra - despite the UAE not exisiting for several hundred of years.

"After only two years, Qutri and the Khawarij were completely exterminated," he added, using the term usually reserved by modern scholars for groups such as Islamic State and al-Qaeda.

"It is as if they were inherited genes or that history is repeating itself," Gomaa told his audience. "So learn this well… we have just two years to wait."

علي جمعة:قطري بن الفجاءة إمام الخوارج من #قطر وآل ثاني أحفاده

والمهلب بن صفرةالذي قاتله كان من #الإمارات ولأجل ذلك ستنتصر أبو ظبي

كده كتير pic.twitter.com/eyUhWThz6o — سامي كمال الدين (@samykamaleldeen) June 29, 2017

Translation: Ali Gomaa: Qutri ibn Fuja'a, the imam of the Khawarif from Qatar and al-Tahni family are his descendants. And Muhalab ibn Sufra who defeated him was from the Emirates. And so Abu Dhabi will win. This is just way too much.

مفتى #السيسي على جمعة يبتكر طريقة جديدة للحصول على "الرُز" من #أبوظبي :

- قطري بن الفجاءة من #قطر

- المُهلّب بن أبي صُفرة من #الإمارات pic.twitter.com/hTeEf3htPz — عبدالله الوذين (@abqatar) June 29, 2017

Translation: Sisi's mufti Ali Gomaa invents a new way to secure more rice from Abu Dhabi

علي جمعة وأغرب تفسير لحصار الإمارات لقطر

ويؤكد خلال سنتين سيتم القضاء على قطر كما حدث في التاريخ!!!!!! ...ما... https://t.co/esl1cFxDif — بصمة بوست (@basmapost2) June 29, 2017

Translation: Ali Gomaa and the most outlandish explanation for the UAE's seige over Qatar. He predicts that within two years Qatar will be exterminated

Recalling Rabaa

Gomaa's words also come after a Saudi columnist threatened Qatar on Wednesday with the same outcome as the Rabaa massacre in Egypt, where security forces killed hundreds of protests who opposed the coup against president Mohamed Mosri in 2013.

Human Rights Watch (HRW) accused Egypt of killing more than 1,150 demonstrators in the wake of the coup, with at least 817 protesters fatally shot overnight on 14 August 2013 in Rabaa al-Adawiya square alone.

At the time, Gomaa had also called the Rabaa protestors Khawarij in a move that many saw as justifying the state’s attack on the sit-in.

"Shoot them in the heart. Blessed are those who kill them," Gomaa had said at the time. "We must cleanse our Egypt from these riffraff… they are hypocrites and seceders."