in 1923, kazakevich graduated from the minsk infantry training courses. between 1923 and 1924 he was assistant chief of a border post in the belorussian border district. in 1924, he became head of a border post of the 42nd jabrayil border detachment. he joined the communist party of the soviet union in 1925. kazakevich became head of a border post of the 38th akhaltsikhe border detachment in 1926. in 1927 he was sent to the higher school of border troops and graduated in 1929. he then became chief of the 21st yampol border detachment. between 1932 and 1934 he was head of the courses at the 2nd kharkov border school. he was sent to the frunze military academy and graduated in 1937. on 14 march 1936 he was promoted to captain. he then became commander of an nkvd motor rifle regiment in the khabarovsk border district. on 29 november 1938, he was promoted to major. from 1939, kazakevich was chief of staff of the border district. on 13 march 1940, he was promoted to colonel. he received the order of the badge of honour on 14 february 1941.