Taking advantage of the weakness of the bey of Algiers, France invaded in 1830 and again rapidly overcame initial resistance. The French government formally annexed Algeria but it took nearly 45 years to fully pacify the country. This period of French history saw the creation of the , which included the French Foreign Legion. The Army was now uniformed in dark blue coats and red trousers, which it would retain until the First World War.