This article examines the role of the Ottoman state as a reference point in Maghrebi historiography through two works from each of Algeria and Tunisia and from two generations of historical writers. Ahmad al-Sharif al-Zahhar (1781–1872), naqib al-ashraf of Algiers at the end of the Ottoman regency, and the Tunisian historian and reformer Ahmad Ibn Abi Diyaf (ca. 1804–74) wrote in conditions of “crisis” in the nineteenth century; the Tunisian establishment intellectual and educator Hasan Husni Abd al-Wahhab (1884–1968) and the Algerian nationalist journalist and publicist Ahmad Tawfiq al-Madani (1899–1983) each sought in different ways to “recover” their countries' histories in the twentieth century. Comparisons and contrasts across these generations and in each country, with their different relationships to the memory of Ottoman rule and their different colonial experiences, illustrate the different ways in which the Ottoman period has been interpreted in the Maghreb. Assimilated as a “natural” aspect of the region's history in the nineteenth century, the Ottoman presence required more overt interpretive work by writers in the twentieth. Across generations, differing preoccupations about the formation of community and state determined how writers approached the Ottoman legacy, which in both cases has generally remained marginal to more widespread perceptions of history and national origins.