Gayev started his military service as an enlisted Red Army man in the Malyshev Communist Battalion (June–August 1918). He participated in the Russian Civil War, took part in a number of battles (Revolt of the Czechoslovak Legion, liquidation of the Makhno Army, the armed forces of Admiral Alexander Kolchak and General Pyotr Wrangel).