Settled by Dacian tribes in ancient times, and later part of the Roman Empire. When the Empire collapsed, Germanic, Avar and Slavic tribes penetrated into the region. In the 11th century, after the defeat of the Voivode Gyula II it became a fief of the Kingdom of Hungary; a certain administrative and religious independence survived, however. The population comprised three basic ethnic and concurrently social groups: the Hungarian nobility, German colonists (craftsmen) and the Szekely (whose ethnic origin has not been fully explained, but who may originally have been Hungarian residents assimilated by Slavic tribes). Administratively, the region was divided into zupas (village confederations), each headed by a zupan who was subject to a chosen voivode. From the end of the 17th century (the 1699 Treaty of Karlowitz) Transylvania was attached to the Habsburg lands, this situation lasting until 1867 (the Austro-Hungarian redistribution), when it became part of Hungary. Today the central part is part of Romania, while the peripheral zupas which were originally Transylvanian are now Hungarian.
The 16th and 17th centuries in particular were politically significant, with Transylvania being administered by Stephen (István) Bocskay, Gábor Bethlen, George I Rákóczy and George II Rákóczy. Princess Zuzana Lórántffy (the wife of George I and mother of George II) invited Comenius to Sárospatak to build a school according to his pansophic and pedagogic principles. Comenius worked at Sárospatak (the Sárospatak Gymnasium) from 1650 to 1654.