The origins of the Turkish peoples are among the nomadic and pastoral peoples who lived east of the Eurasian steppes from the borders of China across Turkestan. Their earliest appearance in history was in what would be today Outer Mongolia, south of Lake Baikal and north of the Gobi Desert. The Turks were once part of a group of Altaic peoples, which includes the Mongols, the Manchu, the Bulgars, probably the Huns, and others. The first group known to be called Turks emerged in the sixth century c.e. The Tu-Kiu founded an empire stretching from Mongolia and the northern frontier of China to the Black Sea. In the seventh century the Arab conquest of Persia carried Islam to the Turkish fringes of Central Asia. In the ninth century and later, many Turks were recruited as slaves for the ʿAbbāsid armies and converted to Islam. Some rose to important administrative positions. The larger portion of Turks, however, still being essentially nomadic in Central Asia east of the Aral Sea, did not accept Islam until the tenth century. Bands of Turks joined in the gradual war of attrition that was being waged by Muslim warriors along the frontiers with the declining Byzantine Empire. A tribe of Turks called the Oghuz (Oğuz) wrested control of Persia from the Ghaznavids and founded the Seljuk Turkish Empire in 1037. The Seljuks took control of Baghdad from the Buyids in 1055. The Seljuk Turkish victory in 1071 over the forces of the Byzantines at Manzikert, northwest of Lake Van, led to the migration of Turkoman tribes into Anatolia. Within a very short time, the Seljuks had penetrated as far as Nicaea (present-day İznik), only 80 kilometers from Constantinople. Although driven away from this city in 1097, their hold on eastern and central Asia Minor was firmly established. By the early twelfth century, most of the Anatolian plateau was a Seljuk principality, which came to be called Rum. The capital of Seljuk Rum was Konya, and in this city there developed a hybrid Islamic culture that combined elements of Arab Sunni Islam with Persian Shia Islam and Turkish mystical humanism. The invasion of the Mongols in the thirteenth century ended the dominance of the Seljuks in Anatolia.
The Ottoman principality of Sogut was one among ten successor-states that survived from the Seljuk Empire and the Mongol protectorate. In the 1290s the ruler of this principality was Osman, from whose name comes that of the dynasty: Osmanli in Turkish. Sogut was located on the Byzantine frontier, closest to Constantinople. As Osman's emirate expanded, it created both the territorial basis and the administrative organization for an empire. Osman's grandson, Murad I, crossed the Hellespont to extend the young empire into the Christian Balkan states. He applied the principle of toleration to allow non-Muslims to become full citizens and rise to the highest offices of state, and thus, at this very early stage, established the character of the vast multilingual and multiethnic Ottoman Empire. In 1453 Sultan Mehmed II conquered Constantinople, and the city's name was changed to Istanbul. In its first two centuries, most of the Ottoman Empire's energies had been directed toward Christian Europe; however, Selim I (r. 1512-1520), called "the Grim" by Westerners, turned his attention toward Asia. He transformed the Ottoman Empire from a Ghazi state on the western fringe of the Muslim world into the greatest empire since the early caliphate. Selim defeated the Safavids and moved fierce Kurdish tribes to eastern Anatolia to seal that border with the Persians. He defeated the Mamluks and took over their vast empire. The Ottomans became the rulers of Syria, Egypt and the Hejaz—the heartland of Arab Islam. At its peak, the Ottoman Empire stretched from the Persian Gulf to Algeria. The empire reached its cultural zenith under the son of Selim I, Süleyman I, "the Magnificent" (r. 1520-1566). His reign also marked an Ottoman cultural renaissance. A considerable poet in his own right, Süleyman encouraged the arts at his court. Like all great civilizations, the Ottoman absorbed and transformed various external cultural influences. The first sultans took from the Byzantines. Selim and Süleyman brought artisans from Tabriz, in western Persia, to beautify Istanbul. Under Süleyman, with the help of Sinan (the son of a Christian from Anatolia and one of the finest architects of all time), Istanbul became a city of true magnificence, at the point of confluence of Eastern and Western civilization. Immediately after Süleyman's death, the Ottoman Empire began to suffer a decline. In the eighteenth and nineteenth centuries it lost several wars to the expanding Russian Empire. It did enjoy another period of cultural renaissance during the reign of Sultan Ahmed III (r. 1703-1730), which is called the Tulip Period. Some reform of the government was accomplished at this time. Nevertheless, the empire lost territory around the Black Sea and in the Balkans during the last part of the eighteenth century and first half of the nineteenth. Russian ambitions were checked by Great Britain and France in the Crimean War (1854-1856), but the Russo-Turkish War liberated Bulgaria, Romania, and Serbia from the control of the sultan. The Ottoman Empire was drawn into World War I, on the side of the Central Powers. With its defeat and the abdication of its last sultan, Mehmed VI, the empire finally collapsed. The Allies sought to divide Turkey among themselves after their victory, but the country saved itself by waging a war of liberation directed by the empire's most successful general, Mustafa Kemal (who would later take the surname "Atatürk"). Turkey made a remarkable recovery under Atatürk's leadership. He abolished the sultanate and the caliphate, and Turkey became a republic on 29 October 1923. It was declared a secular state, and religious toleration was guaranteed by the new constitution. Many other reforms were set in motion to modernize Turkey along Western lines. Turkey remained neutral during World War II, until it joined the Allies in February 1945. It joined the North Atlantic Treaty Organization (NATO) in 1952. Turkey suffered political instability that led to military takeovers in 1960, 1970, and 1980. In 1982 a new constitution was promulgated that provided the reestablishment of democratic government.