 Later, after surprising enrollment into the Moscow military school, he graduated it in 1899 and the Nicholas General Staff Academy in 1905 after three years of study (along with another Ukrainian general Volodymyr Sinclair).Since 1905 Hrekov served in the Leib-Guard Egersky Regiment.From 1908 taught political and military history at the military academy.