At Helsingborg in 1677, he was a key operative in the Great Northern War at Dunamünde, and in 1700 he was instrumental in the defense of the two sieges of Riga. His work in repairing the fortresses of his own country earned for him the title of the "Vauban of Sweden". He was also the founder of the Swedish engineer corps. He retired while in the rank of field marshal in 1702 and died the following year.