In 639, Babylon was a strategic and well-fortified, but provincial, town on the Nile. The fortress there guarded important port facilities and the entrance to an ancient system of waterways that, at its height, enabled navigation between Cairo and the Red Sea. To the invaders from the Gulf, the site must have looked a lot more comfortable and secure than the soon-to-be conquered capital of Alexandria ever would. After all, they may have handily defeated the Byzantine land forces, but they were still a long way from being able to challenge the empire for naval supremacy of the Mediterranean. The new capital of Egypt -- known as Fustat -- was founded on the banks of the Nile near the ancient capital of Memphis and not far from the pyramids at Giza, and here it remained as control of Mohamed's legacy passed from Saudi Arabia to the Baghdad Caliphate. The two most dramatic monuments left from this period are the 9th-century Nilometer on the southern tip of Rawda Island and the Mosque of Ibn Tulun.

At the very foundation of Islamic history is a schism between two groups -- Shi'a and Sunni -- that is still present today. Understanding a little of the religious soap opera that surrounds this fracture is essential to understanding what happened next in Egypt.

When Mohamed died in A.D. 632, leadership of his rapidly expanding movement passed first to the father of his wife, Aisha (a man named Abu Bakr), and subsequently to three more Caliphs. These four became known as the Rashidun, or Right-Guided, and they came from a tight tribal circle that supported Mohamed from the beginning. The last of these men, Ali ibn Ali Talib, was not only Mohamed's cousin, but married to his daughter, Fatima. Ali lost a power struggle to a man named Mu'awiya Abi Sufyan, who had been appointed governor of Syria by his predecessor. It was, as the participants recognized, something of a sea change -- the moment that Islam outgrew its humble origins and became an empire, it went big-time. The schism occurred because some of the followers of Ali would not accept this new succession and began to develop an alternative, independent line of theology and political structures to go with it. One group, ultimately the most important, called themselves the "Supporters of Ali" or shi'at Ali, to differentiate themselves from the supporters of the new Damascus-based Umayyad dynasty founded by Mu'awiya, who associated themselves with the sunna, or way of the Prophet.

For Egypt, this might have all been irrelevant, except that as the Muslim empire expanded across North Africa and ultimately into Spain, the neighboring territory of Tunisia was taken over by a Shi'a group who were originally supporters of Isma'il bin Ja'far and were known, as a result, as Isma'lis. Because they traced their parentage back to Fatima, daughter of Mohamed and wife of Ali, they also came to be known as the Fatimids. By the time the Fatimids were established in North Africa, around 3 centuries had passed since the original dispute and the capital of the Muslim empire had moved from Damascus to Baghdad. No matter -- the first obstacle on their march remained the same: Egypt.

After a number of failed invasions, they finally succeeded in taking the country from the local allies of Baghdad in A.D. 969. The first thing they did was build a new city outside Fustat, which they named Al Qahira (The Victorious); the massive walls of their city define much of what we now know as Islamic Cairo.

There was at least one precedence for this, the city of Al Qatai, built by breakaway Abassid ruler Ahmad ibn Tulun in the late 9th century. Unlike the Fatimid city, however, Al Qatai was completely razed, and today all that remains of it is the Mosque of Ibn Tulun.

As outsiders, the Fatimids trod lightly when it came to religion. Though they were prodigious in their construction of monuments (which include Al Azhar Mosque and Bab Zuweila), there was little pressure on the mass of Sunnis to conform to Shi'a practice (though there was at times heavy promotion of Shi'a festivals), and Christians and Jews alike (despite a few notable and violent exceptions) were allowed to go about their lives. Indeed, on the whole, the Fatimids presided over a period of stability and relative prosperity in which education and the spread of knowledge (they endowed several large public libraries and countless schools) were high priorities. Moreover, they inherited holdings built up by two strong and capable mini-dynasties, the Tulunid and the Ikhshids, and had the resources not only of North Africa to draw upon, but Syria and Sicily as well.

The first three Fatimid rulers were strong and competent, but the government began to fall apart after that with a series of young and incompetent Caliphs who allowed the government to slip into the hands of military commanders. Inevitably, the economy slipped into shambles, and the political legitimacy of the government was undermined. Even at their height, however, the Fatimids had their quirks. It may be unfair to single out the third Caliph, Al Hakim, as typical, because though he was a reasonably competent administrator in many regards, he was also palpably crazy. Amongst his better-known edicts were bans on molakheya, a staple dish in Egypt, and shoes. He was also notorious for touring the city in the company of a slave whose job was to publicly sodomize shopkeepers caught cheating on measures or prices. Personally abstemious, he was in the habit of taking long walks during the night with little or no guard, and on one of these walks he disappeared and was probably murdered, quite possibly with the collusion of his sister. He was formally succeeded by his nephew who, still a minor, ruled with the help of his aunt, the sister who probably had something to do with Al Hakim's mysterious disappearance.

The slide of the Fatimid Empire was arrested by a series of ministers, who initially trimmed back the encroachments on government by the military with a broad-ranging policy of assassination. The last of these ministers was a Sunni Syrian Kurd by the name of Salah al Din Yusuf Ayyub, who took the post in 1169. By this point, the dynasty was in the hands of a scattering of querulous, epigenous siblings who were not up to the challenge of running Cairo, let alone a whole country under attack from a wearying succession of heavily armed invaders from the still undeveloped northern regions of Europe. The credibility of the last of their line -- Caliph Al Adid -- was severely undermined by his making an alliance with the Christian invaders against co-religionists in Damascus. Salah al Din effectively took over when Al Adid died in 1171, and 3 years later was able to have himself declared ruler of Egypt (as well as North Africa, Nubia, and Syria) by the reigning Caliph in Baghdad.

Salah al Din immediately set about modernizing the defenses of Cairo, which included the construction of the Citadel that now overlooks the old Fatimid city and the completion of expanded walls. He then set about using his rule of both Syria and Egypt to shove the plundering hordes of Christian Europeans back to their miserable chilly climes, and in the process founded the Ayyubid dynasty.

A short-lived dynasty, the Ayyubids controlled Egypt until 1250, sowing the seeds of their own destruction with one of the keystones of their military successes against the Europeans.

Mamluke literally means "the owned," and under Salah Ayyub, the sixth and second-to-last Ayyubid ruler, the use of these imported slaves was key to the military. Forming ruthless and highly effective corps of soldiers without particular ties to soil or family, they quickly seized control, marrying into the royal lineage when Shagarat al-Durr (for whom a street in Zamalek is still named) became queen in 1249.

Mamluke rule lasted until 1517, when the Turks once again took control, at least nominally, of Egypt and reduced it again to the status of an imperial province ruled by a pasha (you will still hear ya basha on the streets of Egypt as a term of respect) appointed by Istanbul. In reality, however, the Mamlukes retained most of their local authority (at least until Napoleon's catastrophic invasion of 1798 demonstrated the powerlessness of their outmoded cavalry against modern arms), and the political history of Egypt became the story of their incremental victories over a series of Turkish administrators.

Note: This information was accurate when it was published, but can change without notice. Please be sure to confirm all rates and details directly with the companies in question before planning your trip.