In the summer of 1879, he was an auxiliary member of the Serbian delegation in the International Commission for Determining the Border after the Serbian-Turkish Wars. In October 1879 he was appointed to the Serbian General Staff. From 1879 he taught the General Staff at the Military Academy, and from 1882 the history of wars and strategy. He was appointed commander of the 2nd Infantry Regiment in 1881. He was promoted to the rank of Colonel by the General Staff in 1883. Politically he belonged to the Progressives and became a minister in several Progressive governments at the time. He was Minister of Construction in the Cabinet of Milan Piroćanac from 16 January 1883 to 3 October 1883. After that he was Minister of Defence in the governments of Nikola Hristić and Milutin Garašanin from 3 October 1883 to 6 December 1885. At the beginning of the Serbo-Bulgarian War, in addition to the duty of Minister of Defence, he served as Chief of Staff of the Supreme Command. Because he had no major war experience, he was viewed by the army to be unable to perform both the duties of Minister of War and Chief of Staff of the Supreme Command. He was also an honorary aide to King Milan Obrenović. After the defeat at the Battle of Slivnitsa, the king dismissed his duties as ill and incompetent. At his own request, he retired on 10 January 1886.