In 1846, the United States Army adopted the peaked cap during the Mexican-American war due to the unsuitability of the shako in the hot Mexican climate. In 1856, a form of peaked cap was adopted by petty officers of Britain's Royal Navy, in imitation of an undress headdress worn by officers from as early as 1827. The British Army adopted peaked caps in 1902 for both the new khaki field dress and (in coloured form) as part of the "walking out" or off-duty wear for other ranks. A dark blue version was worn with dress blues by all ranks of the U.S. Army between 1902 and 1917.