Practically, for hundreds of years after Rashidun Caliphate and until the twentieth century, Islamic states followed a system of government based on the coexistence of sultan and ulama following the rules of the sharia. This system resembled to some extent some Western governments in possessing an unwritten constitution (like the United Kingdom), and possessing separate, countervailing branches of government (like the United States) — which provided Separation of powers in governance. While the United States (and some other systems of government) has three branches of government — executive, legislative and judicial — Islamic monarchies had two — the sultan and ulama.