Here's a short story:

The rivalries between the Arab tribes had caused unrest in the provinces outside Syria, most notably in the Second Muslim Civil War of 680–692 CE and the Berber Revolt of 740–743 CE. During the Second Civil War, leadership of the Umayyad clan shifted from the Sufyanid branch of the family to the Marwanid branch. As the constant campaigning exhausted the resources and manpower of the state, the Umayyads, weakened by the Third Muslim Civil War of 744–747 CE, were finally toppled by the Abbasid Revolution in 750 CE/132 AH. A branch of the family fled across North Africa to Al-Andalus, where they established the Caliphate of Córdoba, which lasted until 1031 before falling due to the Fitna of al-Ándalus. 

Ali was assassinated in 661 by a Kharijite partisan. Six months later in the same year, in the interest of peace, Hasan ibn Ali, highly regarded for his wisdom and as a peacemaker, and the Second Imam for the Shias, and the grandson of Muhammad, made a peace treaty with Muawiyah I. In the Hasan-Muawiya treaty, Hasan ibn Ali handed over power to Muawiya on the condition that he be just to the people and keep them safe and secure, and after his death he not establish a dynasty. This brought to an end the era of the Rightly Guided Caliphs for the Sunnis, and Hasan ibn Ali was also the last Imam for the Shias to be a Caliph. Following this, Mu'awiyah broke the conditions of the agreement and began the Umayyad dynasty, with its capital in Damascus. (End of story)

Provide your best guess for the following question. Give ONLY the guess, no other words or explanation.

For example:

Guess: <most likely guess, as short as possible; not a complete sentence, just the guess!>

Here are a few examples of questions and answers:

Question: When was Ali assasinated?
Guess: in 661

Question: by whom?
Guess: by a Kharijite partisan.

Question: WHo finally beat the Umayyads?
Guess: the Abbasid Revolution

Question: Who is Hasan ibn Ali?
Guess: a peacemaker,

Question: what else was he renowned for?
Guess: as the Second Imam for the Shias,

Question: What was his bloodline?
Guess: Muhammad was his grandfather

Question: Where was the Caliphate of Cordoba formed?
Guess: Al-Andalus,

Question: How long did the Caliphate exist?
Guess: until 1031

Question: What happened to it to cause its demise?
Guess: the Fitna of al-Ándalus.

Question: How was ali killed?
Guess: assassination

Question: What did Hasan ibn Ali do with his power?
Guess: He handed over power

Question: To whom?
Guess: Muawiya

Question: Why?
Guess: to keep the people safe and secure

Question: Did he establish a dynasty?
Guess: no

Now answer the following question in the same format.

Question: Did Mu'awiyah keep the conditions of the contract?

no