Having pacified the rebellious Astrakhan, Apraksin was summoned to Moscow, where he was put in charge of the mint and the armoury. In 1707, he was appointed president of the Russian Admiralty. The following year, he was appointed commander-in-chief in Ingria, to defend the new capital Saint Petersburg against the Swedes, whom he utterly routed. On February 25, 1710, aged 48, he became the third Russian ever to be elevated to the comital dignity. In March 1710 he was in command at the Siege of Vyborg. Taking this Swedish fortress in June, he was invested with the Order of St. Andrew and appointed governor of the conquered provinces (Estonia, Ingria, and Karelia).