Prilep was a major center of the Bulgarian national revival in Western Macedonia in the 19th century. One of the largest annual fairs in Macedonia was held in Prilep in the middle of the 19th century. European consulate exhibitions of 1887 estimate the population of Prilep to approximately 6.500 individuals, of which 4.000 were Bulgarians, 2.000 were Turks and the rest were Serbs with Greeks and Aromanians. In the late 19th and early 20th century, Prilep was part of the Manastir Vilayet of the Ottoman Empire. It was occupied by Bulgaria between 17 November 1915 and 25 September 1918 during World War I. In 1918 Prilep became part of the Kingdom of Serbs, Croats and Slovenes, and from 1929 to 1941 it was part of the Vardar Banovina of the Kingdom of Yugoslavia. On 8 April 1941, just two days after the start of the Axis invasion of Yugoslavia, Prilep was occupied by the German Army, and on 26 April 1941 by the Bulgarian Army. Together with most of Vardar Macedonia, Prilep was annexed by the Kingdom of Bulgaria from 1941 to 1944. After 9 September coup d'etat the commander of the Bulgarian garrison, refused to withdraw and remained in the city with the Yugoslav guerrillas, managing to hold it for 10 days, blocking the movement of the German troops. Afterwards the German Army retook the town. Prilep was definitively taken by communist partisans on 3 November 1944. From 1944 to 1991 the town belonged to the Socialist Federal Republic of Yugoslavia, as part of its constituent Socialist Republic of Macedonia. Since 1991 the town has been part of the Republic of Macedonia.