Aganlija (Serbian Cyrillic: Аганлија; fl. 1801–04) was an Ottoman janissary leader that defected and along with three other janissary leaders took control over the Sanjak of Smederevo in 1801. These renegade janissaries were known as the Dahije.
The four leading Dahije, Kučuk Alija, Aganlija, Mula Jusuf and Mehmed-aga Fočić, captured Hadži Mustafa Pasha, the Vizier of Belgrade, in October 1801 and killed him on 15 December 1801 in the Belgrade Fortress. This resulted in the sanjak being ruled by these renegade janissaries independently from the Ottoman government, in defiance to the Sultan. The janissaries imposed "a system of arbitrary abuse that was unmatched by anything similar in the entire history of Ottoman misrule in the Balkans". The leaders divided the sanjak into pashaluks. The tyranny endured by the Serbs caused them to send a petition to the Sultan, which the dahije learnt of. The dahije started to fear that the Sultan would make use of the Serbs to oust them. To forestall this they decided to execute leading Serbs throughout the sanjak, in the event known as the "Slaughter of the Knezes", which took place in late January 1804. According to contemporary sources from Valjevo, the severed heads of the murdered leaders were put on public display in the central square to serve as an example to those who might plot against the rule of the dahije. This enraged the Serbs, who led their families into the woods and started murdering the subaşi (village overseers) that had been employed by the dahije, and also attacking Ottoman forces. The dahije sent out the most diplomatic, Aganlija, with a strong force to frighten and calm them down, in order to avoid escalation into armed conflict which would be hard for the janissaries to manage, but to no avail.
Aganlija and his entourage was attacked during talks in Drlupa with Serbian rebel leader Karađorđe (April 1804). He was wounded in the foot. This was the first big success of the Serbian rebels, which encouraged the people and in short time spread the revolt to most of the nahiyas in the sanjak, as well as two nahiyas in the Sanjak of Zvornik.