When war broke out against the United Kingdom in 1801, Staffeldt received command of the brigade that would cover Fredriksvern against a British invasion. But since the war against Britain in the first phase calmed down after the battle of Copenhagen, Staffeldt and his Jäger Corps was transferred back to Kongsvinger, where he for a while became provisional commander on Kongsvinger Fortress. He also received command over Ullensaker light infantry battalion and the southern skier battalion. In 1803 he was promoted to colonel.
When the war with the United Kingdom broke out again in 1807 after the bombardment of Copenhagen, Staffeldt was located in Holstein. But he was quickly sent to Altona to confiscate British-owned property, and later to Sjælland where he was commissioned to reorganize the coastal defense.
The following winter he returned to Norway and took command over the brigade assembled at Hedrum, and when Denmark–Norway declared war against Sweden in the spring of 1808, he received commanded the Norwegian left wing brigade, which was to defend the border crossings from Elverum towards Kongsvinger with about 1,300 men.[2] The Swedish western army's right wing under Colonel Carl Pontus Gahn, who had orders to advance to Glomma from northern Värmland,[3] therefore met Staffeldt's forces as they moved across the border on 24 April, and were surrounded and forced to surrender at Trangen.[3] After this victory, Staffeldt could concentrate most of his troops around Kongsvinger against Gustaf Mauritz Armfelt's advance. Here he was again given the post as commander of the fortress at the same time as his brigade was reinforced. The fighting that followed led to varying success, but the Swedes retreated back across the border in early June 1808. Staffeldt's and his brigade attracted much attention during this war, and won great acclaim. This was reflected by Staffeldt's promotion to major general and the appointment to Commander of Dannebrog in 1809.
When peace was concluded with Sweden in 1809, Staffeldt was given the command over the troops who were drawn together at Hedrum. From there he took responsibility for much of the reorganization that was done of the Norwegian Army in 1810.[1] In 1813 he received charge of a brigade in Smaalenenes Amt, and when Prince Christian Frederik in the winter of 1814 traveled to Trondheim, Staffeldt became supreme commander of the southern army with the authority to take measures for the countries security.[4]
After Denmark-Norway's final defeat during the Napoleonic Wars in 1814, the Treaty of Kiel was finalized by representatives from Denmark, Sweden and the United Kingdom, and it was determined that Norway should be ceded to Sweden. This however, was something the Norwegians opposed, and instead declared themselves independent and appointed Prince Christian Frederick to Norwegian king.[5] This further led to the outbreak of war between Sweden and Norway in the summer of 1814.[5] On 22 May that year Staffeldt was appointed to lieutenant general, was intended to lead an important role in Norway's defense during the subsequent campaigns against the Swedes. He was given command of a brigade of around 4,000 men who was to lead an active defense east of Glomma. The active defense would, however, prove unsuccessful since King Christian Frederik drew the Norwegian troops back across Glomma against von Staffeldt's advice. The responsibility for the army's weak leadership and the subsequent withdrawal was largely put on von Staffeldt, who had to relinquish his position in favor of Major General Arenfeldt and was instead assigned to ensure the front's left flank.[1] The war was from the Norwegian side also affected by confusion and unclear orders from the headquarters, and after the war Staffeldt was one of those who was convicted.