Reichskriegsflagge (German: [ˈʁaɪçsˌkʁiːksflaɡə], Imperial War Flag) was the official name of the war flag and war ensign used by the German armed forces from 1867 to 1945. A total of seven different designs were used during this period.
The first German imperial war flag was introduced by imperial law on 12 November 1848. The Regent signed it that day, although the National Assembly had already voted for it on 31 July. The law described the commercial and war flag of the emerging new German federal state. The 'German colours' black, red and gold were so popular that it did not seem necessary to mention them in the constitution of 1849. The flag was used for the Imperial Fleet, also during the short battle near Heligoland, on 4 June 1849. This was the first and only maritime battle in which these colours were involved.
The Federal Diet had already adopted the German colours on 9 March 1848, but the Diet and also the Central Power forgot to announce the new flag to the foreign powers. By May 1850, the flag was recognized by the USA, the Netherlands, Belgium, Sardinia, Turkey, Portugal, Naples, Spain, Greece and (conditionally) France. The reestablished German Confederation took over the fleet, but sold it in 1852 and did not make use of the German colours again until the 1860s.
After Prussia defeated Austria in 1866, the North German Confederation was founded by Prussia in order to replace the former German Confederation in which Austria had been the dominant power. The new Confederation eventually became the German Empire after the Franco-Prussian War, hence the Imperial German flags date back to the North German Confederation.
Because Prussia had emerged as the leading German state and the black-red-golden colour scheme was, at that time, associated with pan-Germanism (a Germany including Austria) and the revolution of 1848, the Prussian King and President of the North German Confederation, Wilhelm I, insisted on using new flags inspired by Prussia and without the traditional German colours. Therefore, the North German and eventually Imperial German flags prominently featured the Prussian colours (black and white) as well as symbols like the Prussian eagle and the Iron Cross. And while seafaring was the traditional domain of the Hanse in Germany, virtually all of the 19th century German coastline (including the North Sea coast) and naval power belonged to Prussia after the decisive victory in 1866.