The history of Azerbaijani–British relations dates back to the British expedition, sent from Baghdad to Baku, to prevent Azerbaijan's valuable oilfields falling under the control of Germany and the Ottoman Empire. Nicknamed the Dunsterforce, it was commanded by General Lionel Dunsterville. The Dunsterforce arrived in Baku in August 1918.
After the Battle of Baku, the Dunsterforce withdrew to Persia in September 1918. The Dunsterforce returned to Baku after the Armistice of Mudros ended the conflict with the Ottoman Empire in November of 1918. The force administered the territory under martial law until 1920, when the Bolshevik advance made it impossible for them to stay.