In 1794, he came to be in service of the Swedish army and instructor of War science of Gustav IV Adolf of Sweden.
He also became a favorite of the regent Duke Charles, devoted himself to court service and participated in the contacts between the duke and the Swiss adventurer and Russian spy Christin in 1796.
He served in the Finnish War, was made Adjutant general of Charles XIII and sent to emperor Napoleon I of France to inform him of the Coup of 1809 and negotiate peace for Sweden.
He continued to serve in the Swedish army under Jean-Baptiste Bernadotte, took lave during the war against France in 1814 but did participate in the war against Norway.
His relationship to Bernadotte was not good, and when he was given a position in Pomerania in 1815, he regarded himself exiled and resigned from Swedish service.