On his return he became a close personal friend of the Bavarian Crown Prince Maximilian (afterwards King Maximilian II). In 1848 he was promoted to major, and in that year he distinguished himself greatly as the leader of a Schleswig-Holstein light corps in the First Schleswig War between Denmark and a coalition of German states. At the close of the first campaign he was awarded the Order of the Red Eagle by the king of Prussia, and his own sovereign awarded him the Military Order of Max Joseph and promoted him to lieutenant-colonel. In 1849 he served as chief of staff to the Bavarian contingent at the front and distinguished himself at the lines of Dybbøl. He then visited Haynau's headquarters in the Hungarian War before returning to Schleswig-Holstein to serve as von Willisen's chief of staff in the Idstedt campaign.