As the Mongols expanded, each time they encountered an empire, they offered them two alternatives: a) Pay tribute to the Mongols, b) War with the Mongols and their vassal nations.
The caliphate chose the war option, unaware of the true military strength of the Mongols, who they considered primitive barbarians. The result was the complete destruction of the empire, their infrastructure including libraries, and the death of most scholars.
However, parts of Spain were under Islamic control from 711 AD to 1492 AD, and Sicily from 878 AD to 1060 AD. It was there were books from Islamic libraries were translated to Latin, giving origin to the European Reinassance.