Jewish communities have existed across the Middle East and North Africa since Antiquity. By the time of the Muslim conquests of the 7th century, these ancient communities had been ruled by various empires and included the Babylonian, Persian, Carthaginian, Greek, Roman, Byzantine, Ottoman and Yemenite Jews. Jews under Islamic rule were given the status of dhimmi, along with certain other pre-Islamic religious groups. Though second-class citizens and often persecuted, these non-Muslim groups were nevertheless accorded certain rights and protections as "people of the book". During waves of persecution in Medieval Europe, many Jews found refuge in Muslim lands. Today, Jews residing in Muslim countries have been reduced to a small fraction of their former sizes, with Iran and Turkey being home to the largest remaining Jewish populations. Middle Ages Muslim conquests There were, for a long but uncertain period, a significant number of Jews in Arabia. Historians claim that very large numbers of Jews – as many as 80,000 – arrived after the destruction of the First Temple, to join others already long-established in places such as the oasis of Khaybar as well as the trading colonies in Medina and Mecca (where they had their own cemetery). Another theory posits that these Jews were refugees from Byzantine persecutions. Arab historians mention some 20 Jewish communities, including two of Kohanim. The Constitution of Medina, written shortly after hijra, addressed some points regarding the civil and religious situation for the Jewish communities living within the city from an Islamic perspective. For example, the constitution stated that the Jews "will profess their religion, and the Muslims theirs", and they "shall be responsible for their expenditure, and the Muslims for theirs". After the Battle of Badr, the Jewish tribe of Banu Qaynuqa breached treaties and agreements with Muhammad. Muhammad regarded this as casus belli and besieged the Banu Qaynuqa. Upon surrender the tribe was expelled. The following year saw the expulsion of the second tribe, the Banu Nadir, accused of planning to kill the prophet Muhammad. The third major Jewish tribe in Medina, Banu Qurayza was eliminated after betraying the Muslims during the Battle of the Trench. However, there were many Jewish communities in Medina who continued to live in Medina peacefully after these events such as Banu Awf, Banu Harith, Banu Jusham Banu Alfageer, Banu Najjar, Banu Sa'ida, and Banu Shutayba. In year 20 of the Muslim era, or the year 641 CE,