In 1803 he was a major in the Hanoverian guards-regiment and, when the Convention of Artlenburg dissolved the Hanoverian army on 5 July that year, he was one of the first to join what became the King's German Legion. In 1805 he led an unsuccessful expedition to northern Germany during the War of the Third Coalition and a year later he and his battalion moved to Gibraltar. In 1807 they moved again, to Zeeland, where they fought against Denmark in the Gunboat War (also known as the English Wars). On the return journey his ship sank off the coast of the Netherlands and he was held prisoner in Borkum until being freed in a prisoner exchange in 1808.