Promoted to colonel on December 25, 1899, Tretyakov was with the Russian expeditionary forces in the Boxer Rebellion in northern China.
During the Russo-Japanese War of 1904-1905, Tretyakov distinguished himself with a heroic defense against the Imperial Japanese Army at the Battle of Nanshan, during which he was wounded.
He was promoted to major general on October 22, 1904 and continued to command the 5th East Siberian Rifles throughout the Siege of Port Arthur.
After the end of the war, on October 17, 1910, Tretyakov became inspector of field engineering in the Kiev Military District.
He was appointed commander of the Russian 23rd Army Corps on September 5, 1915, but asked to be transferred to the reserves only a week later.