Born into a clerical family, he joined the military service and participated in battles in the Caucasus from the age of 14.
In 1810, Colonel Kotlyarevsky was ordered to capture the fortified settlement of Megri.
A detachment of 1,500 men under Kotlyarevsky was surrounded by a 10,000-strong enemy corps. During a night attack, Kotlyarevsky routed the enemy. He soon captured a crucial fortress and significant territories, earning him the rank of general.
In 1812, the Persian Shah attempted to turn the tide of the war. However, Kotlyarevsky, with a detachment of 2,000 men, attacked the Persian camp and completely crushed the enemy.
Russian troops advanced on the fortress of Lankaran. The Persians were defeated, and the fortress fell.
The Shah was forced to sign the Treaty of Gulistan in the settlement of Gulistan, on terms dictated by Russia.
During a battle, Kotlyarevsky was found among the fallen with three facial wounds; 40 shrapnel fragments were removed from his skull during surgery.