Following the outbreak of the Austro-Turkish War of 1788–1791, Petrović joined the Serbian Free Corps (), and took part in fighting the Ottomans in western Serbia. The Free Corps was a volunteer militia made up of both Ottoman and Habsburg Serbs that was armed and trained by the Austrians. It was led by a Habsburg Serb officer, Major Mihailo Mihaljević. Petrović's participation in the war brought him invaluable military experience, as well as insight into the Austrians' military techniques. He distinguished himself in combat and was decorated for bravery, reaching the rank of sergeant (). In this capacity, he was given command over a squad of 25 men.