The Ulugh Beg Madrasa (Uzbek: Ulugʻbek madrasasi) is a madrasa (Islamic school) in the historic center of Samarkand, a UNESCO World Heritage Site in Uzbekistan. Together with other monuments, it forms the monumental ensemble of Registan, the old heart of the city. It was built between 1417 and 1421 by the then-Timurid governor of Samarkand, Ulugh Beg, Timur's grandson and prominent astronomer, who was later emperor between 1447 and 1449.
 The madrasa was an important teaching center of the Timurid Empire, where they taught some of the most outstanding scholars of their time, both religious and secular. It is the oldest building in Registan, the only one from the 15th century and the only survivor of a wider architectural ensemble, which included several mosques, caravanserais, a bazaar, and a khanaqah (inn of Sufis). At the site of the latter is currently the Sher-Dor Madrasa, located in front of Ulugh Beg Madrasa.
 The madrasa is one of several monuments erected in Samarkand by Ulugh Beg, who was a great patron of teaching, culture, and science in the city that was the capital of the empire founded by his grandfather Timur. This latter ruled the empire practically independently from 1409, while his father, Shah Rukh, commanded the Timurid Empire from Herat, where he had transferred the capital. Ulugh Beg was himself a scholar and scientist who stood out mainly in the field of astronomy, known primarily for its highly accurate star maps, although they were made without using telescopes.
 Although it is common to present the madrasa as a university, some authors, notably Pierre Chuvin, note that it may be an exaggeration to consider it a true university, similar to those that exist today, because the teaching given there was very much linked to Islam. This was, moreover, consistent with the way its founder viewed learning: despite his facet as a scientist, Ulugh Beg was a very pious Muslim, who considered learning to be an act of reverence for the creation of Allah, so it is an anachronism to treat him as an adept of rationalism.
 It is evident how the worldview and interests of Ulugh Beg were reflected in the madrasa project. For example, its decorative elements fully respect the Islamic ban on the representation of living beings, using mainly geometric and calligraphic motifs, as is usual in most Islamic religious buildings. Nevertheless, some considerable freedoms were taken on the façade. This is decorated with tessellated elements that form a stunning set of "constellations", which can be interpreted as a reference to the passion of the founder of the madrasa for astronomy. In fact, it is known that part of the building was used for some time as an astronomical observatory, before a building designed specifically for this purpose was built—the Ulugh Beg Observatory, of which very little remains today because it was destroyed by religious fanatics in 1449, shortly after Ulugh Beg's death. In addition to the Samarkand madrasa, where he was a teacher, Ulugh Beg founded two others, both also known by his name; one in Bukhara and the other in G'ijduvon, although some authors believe that these were built one of his sons, Abdal.
 Given the similarities between the three madrasas named after the prince–astronomer in terms of plan and height, they may all have had the same architect. The name of the architect of the Bukhara madrasa is known—Ismail b. Tahir b. Mahmad Isfahani—who may have been descended from one of the master builders and artisans captured by the armies of Timur in Isfahan, Iran, who were forced to stay in the Timur's Central Asian domains.
 The building has a rectangular plan, measuring 56 by 81 meters, with a minaret 33 meters high at each of the four angles. Each side consists of blocks with two floors, which surround an inner courtyard. The entrance is made by three successive iwans. The outer iwan, facing Registan square, has a huge 35-foot tall pishtaq (twice the height of the rest of the building) and occupies two thirds of the side of the madrasa. It has an inscription in kufic that reads: "this magnificent facade has a height that is twice that of the sky and has such a weight that the spin of the Earth is delayed". Next to the outer iwan, there is another, smaller one, which in turn gives access to a third, facing the inner courtyard.
 The inner courtyard, measuring 30 by 40 meters, is surrounded by a gallery of two floors, with entrances to the fifty hujras (student housing cells). In the center of each of the courtyard galleries is an iwan. The western side gives access to a long and narrow mosque, located at the rear of the madrasa, where several pieces are on display, namely documents and European engravings from the 17th century. One of the engravings shows Ulugh Beg with a very European appearance. In each corner of the courtyard there is a darskhana (reading or class room), covered by a dome. These rooms flank the mosque room to the west and the main iwan to the east. The placement of classrooms in the corners has been adopted by almost all of the later madrasas in Central Asia, although in more recent madrasas, it is common for one of the corners to be occupied by the mosque, rather than the rear.
 All exterior surfaces are covered by a variegated decorative scheme, executed using hazarbaf, azulejos, hafts, faience, mosaics, and maiolica. Wainscoting and frames are made of marble. The decorative motifs are mainly geometric girih patterns, but there are also floral motifs and inscriptions in kufic. The yellow-brown base helps to highlight the green, yellow, turquoise, and light and dark blue glazes. In the pishtaq of the main entrance, a panoply of blue stars in the decoration demonstrates Ulugh Beg's passion for astronomy.