Ali Bey Mihaloğlu Ali Bey Mihaloğlu or Gazı Alauddin Ali Bey Mihaloğlu , ( 1425 — 1507 ) was an Ottoman military commander in 15th century and the first sanjakbey of the Sanjak of Smederevo . He was one of the descendants of Köse Mihal , a Byzantine governor of Chirmenkia and battle companion of Osman Gazi . Some historians believed that the epic figure of Alija Đerđelez was inspired by Ali Bey Mihaloglu . In 1459 he raided Transylvania , province of Hungary but was beaten by the Transylvanian voivode , uncle of King Matthias and former Regent of Hungary Michael Szilágyi at Futak , and thus was forced to retreat . In 1460 he was able to capture the small advancing army of Szilágyi at Pojejena . He transferred the prisoner to Constantinople to have him decapitated by the orders of the Sultan . In 1460 Ali Bey became the subasi of the Güvercinlik ( Golubac , today in Serbia ) . During one of his expeditions to Banat in 1460 he captured Michael Szilágyi . Later that year sultan awarded him for this success and appointed him as the sanjakbey of the Sanjak of Vidin . He was appointed as sanjakbey of the Sanjak of Smederevo in 1462 / 1463 . In 1462 , as the bey of Smederevo , he constantly harassed the Torontál County of Hungary but withdrew southwards after the reinforcements of Micheal of Szokoly and Peter of Szokoly arrived into the area . In 1463 he assisted Mehmet II in his attack on Bosnia with a distraction attack on King Matthias in Syrmia , but was pushed back by Andrew Pongrácz , the high cup - bearer of Hungary . He suddenly made a flanking move into the heart of Hungary and reached Temesvár , where he ran into John Pongrácz , Voivode of Transylvania and was defeated in a close battle . On 7 February 1474 , Ali Bey Mihaloğlu unexpectedly attacked the town of Várad . Ahead of his 7 , 000 horsemen , he broke through its wooden fences and pillaged the town , burned the houses and took the population as prisoners . Their goal was to rob the treasury of the episcopate , but were resisted by the refugees and clergy in the bishop ' s castle ( at the time the bishop ' s rank was absent , and no records mention the identity of a possible Hungarian captain ) . The town fell but the castle stood , forcing the Ottomans to give up the fight after one day of siege . While retreating , they devastated the surrounding areas . In 1476 Ali was joined by his brother Skender Pasha as he departed from Smederevo and crossed the Danube ahead of 5 , 000 spahi s making a second attempt to reach Temesvár . He was confronted by the Hungarian nobility at Pančevo . He suffered an utter defeat and barely escaped in a small boat . The Hungarians chased him into the valley on the opposite bank of the Nadela where they liberated all the previously captured Hungarian prisoners and also took 250 Ottoman captives . In 1478 he joined Ömer Bey Turahanoğlu when he attacked Venetian possessions . In 1479 Ali Bey launched his biggest attack on the Kingdom of Hungary . He led his army over the Szászsebes region , pillaged Gyulafehérvár , but was stopped by Pál Kinizsi in the Battle of Breadfield . By the end of 1492 Wallachian voivode Vlad Călugărul had already warned the Hungarians of a possible Ottoman offensive from Transylvania . In an attempt to dispose the pro - Hungarian voivode , Bayezid II marched through Wallachia to enter into Hungary . They passed through the Rotenturm Pass and turned towards inner Transylvania along the Olt River . At the time the region lacked a legitimate voivode , but the vice - voivode Stephen Telegdy took up arms and blocked the passage to face the unaware Ottomans on their way back . They managed to retake the plunder and captives and caused the Ottoman forces heavy losses ( a couple of thousand casulties ) . However after the death of his father Vlad , pro - Ottoman Radu IV the Great replaced him in 1495 .