The principality founded by Danishmend Gazi had become one of the most influential powers in Anatolia under Gümüştegin and Emir Gazi (Melik Gazi). After Emir Gazi's death in 1134, however, power turned into an inheritance divided among his sons, and it shrank a little with every division. The man who pursued the effort to pull the dynasty back together for the longest and with the greatest effect was Emir Gazi's son Nizameddin Yağıbasan. He ruled as malik around Sivas and Amasya, and when he died in 1164 he left behind both a state already on the verge of disintegration and two buildings that hold an important place in the history of Anatolian madrasa architecture. The general history of the Danishmendids is told in a separate article; here only his life and the points where it intersects with Amasya are considered.
His Name and Lineage
The word Yağıbasan means "one who tramples and defeats the enemy" in Turkish, and it has been taken as the equivalent of "victorious." Some sources also give it as Yakub Arslan or Yağı Arslan. The second name has caused confusion, because Zülkarneyn of the Malatya branch was known by the same epithet, and Hüseyin Hüsameddin takes particular care to stress that the two were different people. On an inscription of 552 (1157) found in Niksar, his titles are listed as al-Malik al-Alim, al-Adil, Nizam al-Dunya wa'l-Din Abu'l-Muzaffar Yağıbasan b. Melik Gazi b. Melik Danishmend Zahir Amir al-Mu'minin. The same line of descent can be read on a coin struck in his own name. That his coins carry only Arabic writing sets them apart from the coins of Melik Muhammed's time, which bore Greek inscriptions. Hüsameddin considers that the bust on the reverse of one coin, with hair bound by a wreath, must be the ruler's own portrait.
Modern scholarship regards Yağıbasan as a grandson of Danishmend Gazi and a son of Emir Gazi. Emir Gazi had four sons: Muhammed, Yağıbasan, Yağan and Aynüddevle. At their father's death the eldest, Muhammed, took the head of the dynasty, while Yağıbasan obtained the lordship of Sivas. Hüsameddin builds the genealogy differently. Relying on a waqf deed dated 560, he makes Yağıbasan a son of Melik İbrahim and a grandson of Danishmend Ahmed Gazi, and argues that he was not a son of Emir Gümüştegin or of Melik Muhammed. According to the same historian, the deed was drawn up shortly after Yağıbasan's death, since it refers to him as "al-Malik al-Marhum." How the lineage is constructed also changes how Yağıbasan's reign is narrated, and we will return to this difference below.
The Divided Dynasty and Yağıbasan's Rise
With Melik Muhammed's death (1143) the dynasty was effectively split into three branches. Muhammed's son Zünnun established his rule in Kayseri, his uncle Yağıbasan in Sivas, and another uncle, Aynüddevle, in Elbistan and Malatya. Muhammed had named his son Zünnun as heir, but the uncles did not recognize that decision. According to one account, Yağıbasan married the widow of his brother Muhammed and thereby gained a say in the governance of Kayseri as well, and Zünnun had to withdraw to Zamantı for a time; later he managed to regain control of Kayseri. This threefold division marked the beginning of a long struggle in which the members of the dynasty fought one another as much as they fought the Seljuks and their other rivals.
This fragmented picture served the interests of the Anatolian Seljuk Sultan Mesud I. When Mesud supported Zünnun, Aynüddevle and Yağıbasan formed an alliance against him. After Aynüddevle, with Yağıbasan's support, invaded the region of Elbistan and Ceyhan, Mesud marched on Sivas in 1142, took the city, and appointed his youngest son Şahinşah to the governorship of Ankara, Çankırı and Kastamonu. Mesud's policy of expansion alarmed Yağıbasan and Aynüddevle and forced them to ask the Byzantine Emperor Manuel for help. Manuel then besieged Konya but withdrew without result (1146). In these years Yağıbasan moved within a web of shifting alliances among Byzantines, Crusaders, Zengids, Artukids and Seljuks.
His most tangible military success in this period was the conquest of the Black Sea coast. In 1150 he captured Ünye, Samsun and Bafra and came to be known as malik of Sivas and Amasya. When Aynüddevle died in 1152, his son Zülkarneyn succeeded him in Malatya. Yağıbasan called on him to act jointly against Mesud I, but Mesud first brought Yağıbasan under his own authority and then marched on Malatya for the third time and destroyed the city's walls. When Zülkarneyn appeared before the sultan with his mother and begged forgiveness, Mesud left him in place on condition that he remain loyal.
The Struggle with Kılıç Arslan II
When Mesud died in 1155, his son Kılıç Arslan II succeeded him. According to Nikephoros Choniates, of Mesud's two Danishmendid sons-in-law, Yağıbasan had been given Amasya, Ankara and Cappadocia, and Zünnun Kayseri and Sivas. When the sultan's brothers claimed the throne and rebelled, Yağıbasan took it as an opportunity. Taking with him Şahinşah, his nephews Zünnun and İbrahim, and the emir of Malatya, Zülkarneyn, he marched toward Kayseri with a large army. Kılıç Arslan II advanced against him in turn. As the two armies were about to clash, the scholars intervened and the shedding of Muslim blood was averted, and each side returned to its own land.
The peace did not last long. When Yağıbasan entered Elbistan at the urging of the Zengid ruler Nureddin Mahmud, Kılıç Arslan moved quickly. Yağıbasan drove some 70,000 people into the regions beyond the Ceyhan and then confronted Kılıç Arslan. Once again men of religion intervened, and in Sha'ban 550 (October 1155) an agreement was signed between the two sides. This pattern recurred many times in the Danishmendid-Seljuk conflicts. Many of the great battles were ended without actually being fought, through the intervention of scholars and men of religion.
In 1157 Yağıbasan returned Bafra and Ünye, which he had taken earlier, to the Byzantine Emperor Manuel, who was forming a new alliance against Kılıç Arslan II, and joined that alliance, in which Zünnun and Zülkarneyn also took part. The sources also record that in 1159 he allied with the Byzantines and the Zengids and fought Kılıç Arslan. Meanwhile Zülkarneyn, malik of Malatya, had died in 555 (1160) or, according to another report, in 557 (1162), and his son Nasıreddin Muhammed had succeeded him. The event that did most damage to Yağıbasan's relations with the other rulers took place around this time. The daughter of the Saltukid ruler of Erzurum had been married to Kılıç Arslan II and was being sent from Erzurum to Konya with a rich dowry. Yağıbasan had her seized on the road and married her to his nephew Zünnun. According to Hüsameddin, the girl had been forced to apostatize in order to prepare the ground for annulling her marriage. The name of the ruler of Erzurum is given differently in the sources: the TDV entry calls him Saltuk Bey, while Hüsameddin uses the name Melik Fahreddin Muhammed. According to Hüsameddin, this incident enraged not only Kılıç Arslan but all the Turkmen beys against the Danishmendids, and even pious beys who had defended the Danishmendids turned to the Seljuk side.
Kılıç Arslan II marched against Yağıbasan in 1162 but was defeated by the Danishmendid army, which was supported by Byzantine forces. After this defeat he joined forces with Kara Arslan of the Artukids, Necmeddin Alpı, Erzen, and Fahreddin Devletşah, emir of Bitlis, set out again, and captured Sivas in 1163. Yağıbasan went to Çankırı to the side of his son-in-law Şahinşah to seek help, and died there on 4 August 1164.
Amasya and Yağıbasan
Where the Danishmendid capital lay is one of the old disputes of Amasya historiography. Hüsameddin maintains that the center of the dynasty was Amasya. As grounds he points to the fact that Sultan Mesud made Amasya his administrative center in order to seize the entire Danishmendid country, and to the abundance of Danishmendid works in the city. He finds the heading "Danishmendids in Sivas" in the coin catalogues contrary to the historical record. In modern accounts Yağıbasan is usually placed in Sivas, but the phrase "malik of Sivas and Amasya" and the fact that Mesud I gave him Amasya, Ankara and Cappadocia show that Amasya carried weight in his political geography. There is also a report that his son Cemaleddin Gazi ruled around Tokat and Amasya for some two years.
The place names that bear Yağıbasan's name in Amasya are the local trace of this relationship. According to Hüsameddin, the quarter in İçerişehir lying west of the Upper Bath was called Yağıbasaniye after a great han that Yağıbasan had built. The han has been known as Hân-ı Yağıbasan since 560; when his descendant Cemal Gazi Bey repaired it and had its roof covered with lead it took the name Kurşunlu Han ("Leaded Han"), and in time the word "han" dropped away and the quarter remained under its present name, Kurşunlu. Hüsameddin also writes that Yağıbasan lived in Melik Danishmend's palace and in the Altı Bahçe ("Six Gardens") in front of it, and later endowed the palace and the gardens as a waqf. After taking Amasya, Sultan Mesud had his own palace built in İçerişehir and moved there. The qadi who drew up the deed was Şeyhülislam ve'l-müslimîn Sadreddin Muhammed b. İlyas al-Khurasani, and Hüsameddin mentions the same person as Yağıbasan's chief judge.
Hüsameddin also lists the members of Yağıbasan's administration in Amasya. His atabeg was Celâlüddevle Mahmud, his commander of commanders Hüsâmüddevle Hasan b. İltigin, and his chief judge Kemâleddin Ebü'l-Fezâil İlyas b. Hasan al-Khurasani. Celâlüddevle Mahmud built a mosque in the Temenna quarter, near the Fetih Gazi Garden, and endowed the gardens that had come down from his father and grandfather. Hüsâmüddevle Hasan built a mosque near Hân-ı Yağıbasan and endowed the village of Emir Hasan Alanı in the Öz district. His brother Sehmüddevle Hüseyin was emir of Merzifon and left a mosque and a waqf there. The "Dânişmendliler" entry of the TDV İslâm Ansiklopedisi links this circle to the Çağlayan (Çalâkçalık) Bridge of Amasya. The bridge, over the Yeşilırmak six kilometers from the city, was built in the first half of the twelfth century by Hüsâmüddevle Hasan, son of İltegin Gazi, one of Yağıbasan's emirs. Its six wide openings, in a structure about 70 meters long, are spanned by brick arches, and its piers are fitted with cutwaters on the west side. The ruined tower-like remains rising on its axis are presumed to be a kind of history kiosk, and in this respect the bridge is regarded as the earliest example of the history kiosks that would later become an indispensable element of Ottoman bridge design.
The Küçük Ağa Complex in Amasya is a group of buildings whose foundation goes back to the Danishmendid period but which was almost entirely renewed by the Ottomans in the late fifteenth century. The Yağıbasan Han and the Danishmend Gazi Palace, by contrast, are Danishmendid works known from the sources but not surviving to the present. It may be said that Yağıbasan's era was, for Amasya, the last brilliant phase of the Danishmendid age. After this phase the city gradually entered the Seljuk orbit.
The Sequence in Hüsameddin's Account
Hüseyin Hüsameddin's chronology departs from the course of events in modern sources at several points. According to him, Yağıbasan came from the emirate of Niksar and became ruler in Amasya at Sultan Mesud's urging and with the approval of the Turkmen beys, while Melik Muhammed, who had until then resided in Amasya, was sent to Niksar. Hüsameddin dates this event to 535 and cites the Târîh-i Âl-i Dânişmend as his basis. When Mesud took the Danishmendid country in 538, Yağıbasan withdrew to Niksar again. In the following years, we are told, Yağıbasan took advantage of the Seljuk emirs' presence at the battle of Ankara to proclaim his rule again at Niksar, appointing his son Cemal Gazi to Amasya, his nephew İbrahim to Kayseri and Zünnun to Sivas. That Cemaleddin İsmail was made governor of Amasya by his father in 556 and expelled the men of Sultan Şahinşah from the city is part of the same account. In a footnote Hüsameddin notes that Cemal Gazi's name was İsmail, established by a legal ruling issued by the Amasya qadi Celâleddin Abdurrahman al-Muslihi.
Hüsameddin dates Yağıbasan's death to Dhu'l-Hijja 560 and writes that he died in Niksar. According to this account, Yağıbasan, pressed from east and west, fell ill from the distress of seeing all the Turkmen beys turn against him and died soon afterward. His eldest nephew Tâceddin İbrahim succeeded him. The modern account, by contrast, gives Çankırı as the place of death and 4 August 1164 as the date. Who took the throne after his death is also disputed. According to some reports, Yağıbasan's wife married İsmail, the sixteen-year-old son of İbrahim, Zünnun's brother, and proclaimed him ruler. Other sources say that his son Cemaleddin Gazi succeeded him but that he remained on the throne for so short a time that historians do not mention him.
According to Hüsameddin, Sultan Şahinşah captured Amasya in 562 and put an end to Cemal Gazi's rule. Tâceddin İbrahim, who came to Cemal Gazi's aid, fought Şahinşah in the district called Yuvaş (later Cuma Pazarı, Azine Pazarı, İnepazarı), was defeated and was killed. His son Şemseddin İsmail took his father's body and fled to Niksar and took his place. These records show how closely, in the dynasty's last phase, the fortunes of the emirs settled in Amasya were intertwined with those of the Seljuk princes. The modern account, for its part, states that Cemaleddin Gazi, after ruling around Tokat and Amasya for two years, was eliminated by his cousin İbrahim (562/1166).
His Madrasas and Architectural Legacy
Yağıbasan's name is today remembered above all for two madrasas. The first is the Yağıbasan Madrasa in the center of Tokat. Because the road level around it rose over time and its floor now lies about 1.25 meters below the present street, it is called the Çukur Madrasa ("Sunken Madrasa") among the local people. The madrasa is generally dated to 1151-1152, though some publications state that construction began in 1148 and was completed in 1157. No original inscription of the building has survived. In sixteenth-century waqf records it appears under the name "Vakf-ı Medrese-i Yağıbasan." The building was repaired during the reign of the Seljuk sultan Izz al-Din Kay Ka'us II and was also used as a shelter for migrants in the Ottoman period.
The second madrasa stands in the inner citadel of Niksar Castle, on a site leaning against the walls, and is dated to 1157-1158. Like the one in Tokat, it has a closed-courtyard plan and is covered by a dome about 11 meters in diameter. It has two iwans on its east and north sides and small barrel-vaulted rooms on the west. According to an inscription, the madrasa underwent a comprehensive repair in 1247, and in later centuries the local people used it as a smithy, shops and a storehouse. Today only wall remains survive. The TDV entry also reports that an inscription dated 552 (1157), belonging to a madrasa or mosque built by Yağıbasan, exists in Niksar today.
In the Tokat madrasa, built of rubble stone, a three-iwan variant of the four-iwan layout, one of the oldest design schemes of Turkish architecture, was applied. The small iwan to the north forms the entrance. The iwan with the mihrab on the west, in the direction of the qibla, was used as the lecture hall. The dome covering the courtyard reaches a diameter of 14 meters and has a wide opening at its center. This size points to a rather advanced construction technique for the period in which it was built. For a long time dome diameters in Anatolia remained around 8-10 meters, and the dome of the Tokat madrasa was surpassed only by the 17-meter dome of the Eski Çine Ahmed Gazi Mosque, dated to the first quarter of the fourteenth century. The squinches at the corners, the dome with its central opening, and the lecture halls and cells lined around the courtyard form the core of the design in both buildings.
Yağıbasan's madrasas are among the earliest examples of the group called "domed madrasas" in Anatolian Turkish architecture. The most splendid examples of this type are found in the thirteenth century. The closed-courtyard layout is sometimes linked to the harsh winters of the region, but this is an interpretation and has no firm documentation in the sources. Both madrasas are plain and undecorated. The main material is rubble stone. Brick was used in the dome, the squinches and some transitional elements, and cut stone in door openings and some arches. It is noted that in the madrasas, alongside the Islamic sciences, subjects such as mathematics and astronomy were also taught. That two buildings with the same plan rose in two different cities suggests that Yağıbasan took up this work deliberately at a time when the madrasa institution was beginning to take root in Anatolia.
There are other buildings in Niksar attributed to Yağıbasan. According to the TDV entry, Yağıbasan had mosques, tombs and soup kitchens built in Sivas and Niksar. The Niksar Great Mosque (Melik Gazi Mosque), though without an inscription, is dated by oral tradition to 540 (1145), and it is thought that it must have been built by Yağıbasan himself during his reign. There is also a local tradition that a certain Çepnizade Hasan Bey had it built. The Yağıbasan Masjid and Tomb are counted among the Niksar works that are partly standing but have largely lost their architectural character. The Yağıbasan Khanqah and the Zahîrüddin İli Han in Sivas are known from the sources but have not survived. The Kölük Mosque and Madrasa in Kayseri is also thought to have been built by Yağıbasan between 1143 and 1164. An inscription above the portal of the building records that in 1210 the ruler's granddaughter Atsız Elti Hatun had it repaired.
His Tomb and Children
Yağıbasan is buried in the cemetery of the madrasa he himself built in Niksar. Hüsameddin's account agrees with this information as to the place of death, but it does not agree with the account in modern sources of his death in Çankırı. The inscription of 552 in Niksar has been mentioned. It is the most direct document carrying the ruler's identity and titles down to the present.
Yağıbasan had children named Cemaleddin Gazi, Muzafferüddin Mahmud, Zahîrüddin İli and Bedreddin Yusuf. Apart from Cemaleddin Gazi, his sons entered Seljuk service. Some historians write that Cemaleddin Gazi's real name was İsmail. After the dynasty fell, Muzafferüddin Mahmud, Zahîrüddin İli and Bedreddin Yusuf fought the Greeks on the frontier with the Seljuk army and worked for the second accession of Kaykhusraw I to the throne. The inscription of 602 (1205-1206) on the Kayseri Great Mosque was drawn up in the name of Muzafferüddin Mahmud. Since it is known that the mosque was built by Melik Muhammed Gazi, it is likely that Mahmud repaired it.
The End of the Dynasty
After Yağıbasan's death, struggle among the members of the dynasty began again. Mahmud b. Mehdî, emir of Elbistan, declared his independence. Zünnun, malik of Kayseri, and Yağıbasan's nephew İbrahim also moved with the same aim. Kılıç Arslan II seized the opportunity and marched on Elbistan in 1165, annexing Elbistan, the Tohma valley, Darende and the Gedük region. In 1168 he went against Zünnun. He ended Danishmendid rule in Kayseri and Zamantı in 1169, or according to other reports in 1171 or 1173. Zünnun took refuge with Atabeg Nureddin Mahmud Zengi, together with Kılıç Arslan's brother Şahinşah and Efridun, malik of Malatya.
This transition was not an abrupt rupture. Many Danishmendid emirs continued to exist in Seljuk service, and Yağıbasan's sons were among them. A part of the buildings of the Danishmendid period, such as mosques, madrasas, hans and bridges in Tokat, Niksar and Amasya, remained standing and continued to be used in later centuries. A detail recorded by Hüsameddin shows this continuity. A scholar from Merzifon served as müderris and mufti at the Yağıbasaniye Madrasa in Niksar and died after the year 800 (1397-1398). The madrasa Yağıbasan built was still giving instruction some two centuries after its founder's reign.
Chronology
1134: Death of Emir Gazi, accession of Melik Muhammed.
1142: Mesud I takes Sivas.
1143: Death of Melik Muhammed, division of the dynasty into three branches.
1150: Yağıbasan takes Ünye, Samsun and Bafra.
1151-1152: Construction of the Yağıbasan Madrasa in Tokat (1148-1157 in some publications).
1155: Death of Mesud I, accession of Kılıç Arslan II; agreement signed in October.
1157: The Niksar inscription dated 552; return of Bafra and Ünye to Byzantium.
1162-1163: Defeat of Kılıç Arslan II, followed by the capture of Sivas.
1164: Death of Yağıbasan (4 August; Hüsameddin gives Dhu'l-Hijja 560).
1165-1169: Kılıç Arslan II annexes the Danishmendid lands.
Sources
Primary sources
- Hüseyin Hüsâmeddin Yasar, Amasya Tarihi, vol. 1 (Danishmendid period, quarters) and vol. 2 (biographies).
Academic studies
- Ayşe Denknalbant Çobanoğlu, "Tokat ve Niksar'da Bazı Selçuklu ve İlhanlı Yapılarındaki Çini Süslemeler Üzerine Bir Değerlendirme," Vakıflar Dergisi 51 (2019), pp. 9-44.
Official sources
- Republic of Türkiye Ministry of Culture and Tourism, Kültür Portalı, "Yağıbasan Medresesi - Tokat."
Other sources
- TDV İslâm Ansiklopedisi, "Dânişmendliler" entry. islamansiklopedisi.org.tr
- Vikipedi, entries "Nizâmeddin Yağıbasan," "Yağıbasan Medresesi (Tokat)" and "Yağıbasan Medresesi (Niksar)." tr.wikipedia.org
Online sources









