The History of Moroccan Astronomy: Marinid Observatories and the Stars of Fez

The history of Moroccan astronomy begins not in a desert observatory but in a mosque school in Fez, where scholars measured the sky to fix the hours of prayer. For more than a thousand years, Moroccan astronomers built astrolabes of engraved brass, taught the stars in madrasas and kept water clocks ringing over crowded streets. Their story — the history of Moroccan astronomy — runs from the Qarawiyyin in 859 to the telescopes of the High Atlas today.

This is a history of instruments and institutions as much as of ideas. Morocco never built a giant state observatory like Maragha in Persia, yet its astronomers made instruments now held in museums from Oxford to Strasbourg, and a water clock in Fez whose mechanism still defeats modern engineers. The thread is practical: the history of Moroccan astronomy was always about using the sky — to pray on time, to find Mecca and to plant at the right season.

Every date below in this history of Moroccan astronomy comes from published scholarship, and where the sources disagree, this guide says so plainly. Our History & Heritage section covers the wider story of the country; this article follows one thread through it — the stars.

The facade of the Dar al-Magana water clock in Fez with twelve small windows and wooden beams above Talaa Kebira street at golden hour, from this guide to the history of moroccan astronomy

In this guide

Moroccan Astronomy at a Glance

FactDetail
First schoolQarawiyyin, Fez, founded 859 by Fatima al-Fihri
Great astronomerIbn al-Banna al-Marrakushi (1256–1321), ~100 works
Most famous instrumentDar al-Magana water clock, Fez, completed 6 May 1357
Master astrolabistAbu Bakr ibn Yusuf, active 1188–1219
Oldest surviving Moroccan astrolabeDated 1206–07, made in Marrakech
Modern observatoryOukaimeden, High Atlas, 2,700 m, founded 1988
Why it matteredPrayer times, the qibla, calendars, desert navigation

Why the Stars Mattered in Medieval Morocco

The history of Moroccan astronomy was never a story of abstract ideas. Five times a day, the call to prayer had to fall at the right moment, and that moment was defined by the sun: dawn, noon, afternoon, sunset and nightfall. Without clocks, the only reliable way to know the hour was to watch the sky, and the men who did it professionally were the muwaqqits, the mosque timekeepers.

The second task was direction: every mosque faces the qibla, the direction of Mecca, and fixing it across a kingdom required spherical trigonometry. Scholars debated the correct qibla of Fez and Marrakech for centuries; getting it right was astronomy applied to architecture.

The Qarawiyyin: Fez's First School of the Stars

The Qarawiyyin was founded in Fez in 859 by Fatima al-Fihri, and it grew from a mosque into one of the oldest continuously operating centres of learning in the world. Astronomy was taught there from early on, alongside law, grammar and medicine, because a mosque school needed men who could fix prayer times and the calendar.

Its scholars worked in a tradition that reached Fez through al-Andalus: texts from Baghdad and Cordoba arrived with travelling teachers, were copied in Fez, and were taught, corrected and extended. By the 12th century the Qarawiyyin was producing men who could compute planetary tables and build instruments, drawing students from across the Maghreb. Read our guide to the manuscripts and libraries of Morocco for the book culture behind it.

What exactly was taught is not settled — the early centuries left few syllabuses behind — but by the Marinid period the mosque and its madrasas taught astronomy as a recognised discipline. The institution, not any single genius, is the real starting point of the history of Moroccan astronomy.

The History of Moroccan Astronomy Under the Marinids

The Marinid dynasty (1244–1465) turned Fez into a capital of learning, and the history of Moroccan astronomy reaches its high point under their rule. Sultan Abu al-Hasan and his son Abu Inan Faris founded a chain of madrasas — the Saffarin in 1271, the Attarine in 1323–1325 and the Bou Inania in 1350–1355 — each teaching astronomy alongside law and theology. Our guide to the Marinid madrasas of Fez walks through these buildings today.

The Marinids also built the instruments. The water clock opposite the Bou Inania Madrasa, completed in 1357, was a royal commission, and the great astrolabes of the period were made for princes and sultans. The history of Moroccan astronomy under the Marinids was a court science: visible, expensive and meant to be seen — which is why so much of it survives, in stone, in brass and in the chronicles.

Ibn al-Banna al-Marrakushi: Morocco's Star Mathematician

No single figure matters more to the history of Moroccan astronomy than Ibn al-Banna al-Marrakushi, born in Marrakech on 29 or 30 December 1256 and dead there on 31 July 1321. He studied under at least seventeen masters, taught in Marrakech and at the Attarine Madrasa in Fez, and wrote around a hundred works, about fifty on mathematics and astronomy.

His most famous book, the Talkhis amal al-hisab (Summary of Arithmetical Operations), became a standard textbook across the Maghreb for centuries; commentaries on it were still being written in the 19th century. He was among the first to treat a fraction as a ratio between two numbers, and he is credited with the first use of the word almanac — from the Arabic al-manakh, meaning weather.

In astronomy he followed the Andalusian tradition of al-Zarqali, the great Toledan astronomer of the 11th century, and compiled a zij — astronomical tables that made planetary positions computable without advanced theory. His Kitab al-anwa tied the rising and setting of stars to the farming year, in the old anwa tradition that matched star risings to the weather farmers should expect. He probably served as astrologer to the Marinid sultan Abu Sa'id (reigned 1309–1331), and tradition says he predicted the exact circumstances of the sultan's death. Whether he was born in Marrakech or Granada is still debated; what is certain is that he spent his life in Morocco, and later scholars called him the last creative mathematician of the Maghreb.

Dar al-Magana: The Water Clock That Rang the Hours

On 6 May 1357, on Talaa Kebira, the busiest street of Fez el-Bali, Sultan Abu Inan Faris unveiled a clock unlike anything the city had seen. Dar al-Magana — the House of the Clock — stands opposite the Bou Inania Madrasa, finished two years earlier. Its designer was the muwaqqit Abu al-Hassan ibn Ali Ahmed el-Tlemsani, a mathematician and astronomer from Tlemcen whose speciality was trigonometry and the measurement of time.

The facade carries twelve small windows, each above a brass bowl on a wooden beam. Every hour, one window opened and a metal ball dropped into its bowl with a clang the whole street could hear. Behind the wall, a small cart moved along a track, driven by weights and a float in a water reservoir that emptied at a calibrated rate. By the twelfth hour, all twelve bowls held a ball, and the medina knew the time.

The clock served the Bou Inania mosque — the only madrasa in Morocco that also functioned as a Friday mosque — so exact prayer times were a religious necessity. The Bou Inania costs about 20 MAD (about $2) to enter, checked November 2026.

Then it stopped. Nobody knows exactly when, and nobody alive knows exactly how it worked. The brass bowls were removed in 2004 by ADER-Fes so the mechanism could be studied — and no engineer has yet rebuilt it. You can still see the facade today, four minutes' walk from Bab Boujloud: the most eloquent monument in the history of Moroccan astronomy, a machine that told the time for a whole city and a puzzle that has outlasted its makers by nearly seven centuries.

The Astrolabe Makers of the Maghreb

If the water clock was astronomy you could hear, the astrolabe was astronomy you could hold: a brass disc engraved with the sky, fitted with interchangeable plates for different latitudes and a pierced rete that mapped the stars. It told the time from the sun or a star, found the qibla and measured the height of a building, and Moroccan craftsmen were among the best makers in the medieval world — their work is central to the history of Moroccan astronomy.

The leading astrolabist of the medieval Maghreb was Abu Bakr ibn Yusuf, active between 1188 and 1219. At least seven of his instruments survive, including an astrolabe mater made in Marrakech in 1206–07 for the Almohad prince Abu Muhammad Abd al-Haqq. Another, dated 1208, is now displayed at the Strasbourg Observatory. The engraving is so fine — scales divided to a single degree, calendar rings, a 28-year solar cycle — that scholars still study these pieces as historical documents.

Moroccan makers also built the rare universal astrolabe, a design described by al-Zarqali that works at any latitude: one made in Morocco in 1327 is among the finest in the world. An astrolabe by Muhammad ibn Ahmad al-Battuti (1728) and a quadrant inscribed for Meknes (1804) show the craft lasting five centuries.

A medieval Moroccan brass astrolabe with engraved rete and latitude plates on dark cloth, from this guide to the history of moroccan astronomy

The Nasiriyya Zawiya of Tamegroute: A Desert Observatory

In the Draa Valley, far from Fez, the Nasiriyya zawiya of Tamegroute holds a stranger chapter of the history of Moroccan astronomy. The zawiya — a Sufi lodge and centre of learning — is described by the 17th- to 18th-century scholar al-Asfi as housing giant astronomical instruments, used for observation and calculation by the sun's rays, a tradition that runs from the great observatories of the Islamic East into the Moroccan desert.

Scholars debate whether Tamegroute was an observatory at all — the evidence is thin: a description, a building, a tradition of teaching. What is not in doubt is that astronomical teaching reached deep into the south, and the zawiya's library kept the science alive centuries after the Marinids were gone. Our guide to Tinmel, the Almohad capital of the Atlas tells a parallel story of a mountain centre of learning.

What the Records Do Not Tell Us

A good history says what it does not know, and the history of Moroccan astronomy has honest gaps. First, no state observatory in the Maragha sense has ever been proven in Morocco: the eastern observatories had directors, staffs and funded programmes, while the Moroccan evidence points to observation posts, madrasa teaching and mosque timekeeping instead. Some call the distinction one of scale, not of kind — but until a document or a ruin says otherwise, the claim stays unproven.

Second, the exact mechanism of the Dar al-Magana water clock is unknown. Chroniclers describe what it did, not how it did it, and restoration attempts since 2004 have not reproduced it. Any diagram claiming to show the inner workings is a reconstruction, not a record.

Third, the dates are often approximate. The Qarawiyyin in 859 and the water clock on 6 May 1357 are solid — the chronicler al-Jaznai records the latter — but the birthplace of Ibn al-Banna and the date of the earliest Moroccan astrolabe are debated. A legend says Maimonides once lived in the Dar al-Magana building; it is unconfirmed, a later tradition rather than a record.

Timeline: A Thousand Years of Moroccan Astronomy

DateEvent
859Qarawiyyin founded in Fez by Fatima al-Fihri
11th centuryAl-Zarqali of Toledo, whose work shapes Moroccan astronomy
1206–07Abu Bakr ibn Yusuf makes an astrolabe in Marrakech
1256Ibn al-Banna born in Marrakech
1271Saffarin Madrasa founded in Fez
1317Water clock built for the Qarawiyyin by Sultan Abu Said
1321Ibn al-Banna dies in Marrakech
1323–1325Attarine Madrasa founded in Fez
1327Universal astrolabe made in Morocco
1350–1355Bou Inania Madrasa built in Fez
6 May 1357Dar al-Magana water clock completed
1728Al-Battuti astrolabe made in Morocco
1804Astrolabe quadrant made for the latitude of Meknes
1988Oukaimeden Observatory founded in the High Atlas
1999Rabat Observatory founded

The timeline shows the shape of the whole history of Moroccan astronomy: a medieval peak under the Marinids, a long quiet spell, and a modern revival in the mountains.

Where to See Moroccan Astronomy Today

Start at the Dar al-Magana itself, on Talaa Kebira in Fez el-Bali, opposite the Bou Inania Madrasa. Go in the morning, when the light strikes the facade, and look up: twelve windows, thirteen beams, and the empty brackets where the brass bowls hung. The Bou Inania across the street is one of the few religious buildings in the medina that non-Muslim visitors can enter, for about 20 MAD (about $2), checked November 2026; it closes during prayers and on Fridays. For the dynasty that built both, see our history of Morocco, our guide to Ibn Battuta, the Moroccan traveller and the Marinid tombs above the city — and read about LahbabiGuide for more of our Morocco guides.

The modern chapter in the history of Moroccan astronomy lives in the mountains: the Oukaimeden Observatory, at 2,700 metres in the High Atlas, was founded in 1988 by Cadi Ayyad University; the Rabat Observatory followed in 1999. Neither is a regular tourist visit — check with the universities first — but on a clear night in the Atlas, the sky the Marinid astronomers measured is still there. Read more on Wikipedia and the UNESCO page for the Medina of Fez.

The Oukaimeden Observatory domes under a star-filled night sky in the High Atlas mountains, from this guide to the history of moroccan astronomy

Frequently Asked Questions

Did Morocco have an observatory in the Middle Ages?

Not in the sense of a state-funded observatory with a director and staff, like Maragha in Persia (1259). The evidence points to observation posts attached to mosques, madrasas and zawiyas, and to salaried timekeepers. The history of Moroccan astronomy is a story of teaching and instruments, not of one great building.

What is the Dar al-Magana water clock?

A weight-powered water clock in a facade on Talaa Kebira in Fez, completed on 6 May 1357 by order of the Marinid sultan Abu Inan Faris. Every hour a metal ball dropped into one of twelve brass bowls; it has not worked for generations, and its exact mechanism is still unknown.

Who was Ibn al-Banna al-Marrakushi?

A Moroccan mathematician and astronomer (1256–1321) who taught in Marrakech and at the Attarine Madrasa in Fez, and wrote around a hundred works, including the textbook Talkhis amal al-hisab and a star calendar, the Kitab al-anwa. He is often called the last creative mathematician of the Maghreb.

What is a Moroccan astrolabe?

A brass instrument from the history of Moroccan astronomy, engraved with the sky, that told the time from the sun or a star, found the direction of Mecca and measured heights. The finest Moroccan maker was Abu Bakr ibn Yusuf (active 1188–1219), and his instruments are now in museums in Oxford, Strasbourg and elsewhere.

Can I visit the Dar al-Magana in Fez?

Yes — a facade on a public street, Talaa Kebira in Fez el-Bali, opposite the Bou Inania Madrasa, a few minutes from Bab Boujloud. You cannot go inside, and the bowls were removed in 2004, but the facade is free to see at any hour.

Where is astronomy studied in Morocco today?

At the Oukaimeden Observatory in the High Atlas (1988) and the Rabat Observatory (1999), run by Moroccan universities. Around twenty amateur astronomy clubs are active, and the history of Moroccan astronomy continues in a modern form.

Conclusion

The history of Moroccan astronomy is not a story of one discovery or one genius. It is a story of a skill a whole society needed: the mosque needed the hour, the caravan needed the stars, the farmer needed the calendar. From the Qarawiyyin in 859 to the water clock of 1357 and the telescopes of Oukaimeden, Morocco kept looking up — and kept building instruments to prove what it saw.

Go to Fez, stand on Talaa Kebira and look at the twelve empty windows of the Dar al-Magana. The clock has been silent for centuries, and no engineer has yet made it ring again. That silence is the point: the history of Moroccan astronomy survives in stone and brass because it was built to be used, not admired — and the sky above the medina is still the sky the muwaqqit watched.

Leave a Comment