He was educated at home and in the Kyiv-Mohyla Academy. Upon finishing his education, he entered the public service as a clerk in the office of Count P. A. Rumyantsev, then Governor-general of Little Russia, whom he accompanied to the Turkish War in 1768. He was present at the engagements of Larga and Kagul, and at the storming of Silistria.