In the 13th and the 14th century, Macedonia was contested by the Byzantine Empire, the Despotate of Epirus, the rulers of Thessaly, and the Bulgarian Empire, but the frequent shift of borders did not result in any major population changes. In 1338, it was conquered by the Serbian Empire, but after the Battle of Maritsa in 1371 most of the Serbian lords of Macedonia acknowledged Ottoman suzerainty. After the conquest of Skopje by the Ottoman Turks in 1392, most of Macedonia was formally incorporated into the Ottoman Empire.