In AD 827, al-Mamun officially declared that Muhammad’s cousin Ali, the paragon of the Shia and their first imam, was the best of all Muhammad’s Companions. Even more striking than the move toward Shia sympathies was his alignment with Shia rationalism: He declared the Quran to be a created book.