Ibn Habban and Ibn Majah narrated from Ibn ‘Abbas, he said: “The Messenger of Allah ﷺ said, ‘Allah has forgiven my Ummah for the mistake and forgetfulness and that which they were compelled to do.’”
What happened in 1258?
Hordes of Mongols invaded the Caliphate and ransacked the capital Baghdad. They murdered the Abbasid Caliph Al-Musta’sim and imprisoned members of the Abbasid ruling family. The Mongols didn’t stop there but their armies continued west to Egypt and ash-Sham. The Caliphate was under siege and in a state of emergency. The Sultans (semi-independent wulah) who were Turkish and not from Qureysh, therefore couldn’t be Caliphs according to the prevalent opinion at that time, led the fight against the Mongols. Sultan Qutuz in Egypt won a decisive victory against the Mongols at the Battle of Ain Jaloot in 1260 and halted their invasion. Members of the Abbasid family were released from prison in Baghdad, one of which was the son of the previous Abbasid Caliph Az-Zahir. He then fled to Cairo where he presented himself to Baibars, the new Sultan. The Chief Qadi in Cairo affirmed he was from the ruling Abbasid family (i.e. from Qureysh) and Baibars gave him Bayah in 1261.
Therefore, Muslims were compelled in an emergency situation of war similar to what happened with Yazid where technically there was no legitimate Caliph for 4 years while the sahaba were fighting Yazid’s army.
An additional point of note here. Genghis Khan’s grandson Berke Khan converted to Islam in 1252. He was outraged at Hulagu attacking Baghdad and he pursued and defeated Hulagu in 1263. The Mongols or Tartars as they are also known accepted Islam. Again Islam prevailed.