The Battle of Vranje, or the Liberation of Vranje (Serbian: Ослобођење Врања / Oslobođenje Vranja), represented one of the final stages of the second phase of the Serbian–Ottoman War (1876–78). At the beginning of the war, the Serbian army began the offensive in what is today South Serbia. After the , the Serbian army managed to break into the Masurica Valley leaving the road to Vranje open and unguarded. At the same time, many rebellions broke out in the Serbian-Ottoman border areas, including in the Vranje region, against Ottoman authority. To help the rebels, the Serbian command decided to send Lieutenant Stepa Stepanović to form a special rebel battalion.