During the Swedish campaign against Norway in 1814, Krebs was appointed head of a division in the district around Kongsvinger. Here he successfully led the defense of Lier entrenchment, and the counter-attack that drove the Swedes back across the border at Matrand. The Norwegian victories at Lier and Matrand strengthened the morale among the Norwegian population and King Christian Frederik was sure that the fortunes of war had turned in favor of Norwegians. Although the war ended with a Swedish victory after the Convention of Moss, Krebs was hailed as the "hero from Lier and Matrand", and was considered to have saved Norway's pride in an otherwise despondently campaign. After the union between Norway and Sweden was signed, Krebs was promoted to colonel and became adjutant to Charles XIII in 1816. In 1818 Krebs was appointed commander of the 1st Akershus Brigade, but died the same year.
