Coming from the great Repnin family, Anikita was one of the collaborators of Peter the Great, with whom he grew up. On the occasion of the Sophian insurrection of 1689, he carefully guarded Peter in the Troitsa monastery, and subsequently took part in the Azov expedition, during which he was raised to the grade of general. He took part in all the principal engagements of the Great Northern War. Defeated by Charles XII at Holowczyn, he was degraded to the ranks, but was pardoned as a reward for his valour at Lesnaya and recovered all his lost dignities. At Poltava he commanded the centre. From Ukraine he was transferred to the Baltic Provinces and was made the first Governor-General of Riga after its capture in 1710. In 1724 he succeeded the temporarily disgraced favorite, Menshikov, as war minister. Catherine I made him a field-marshal.