The Embassy of the United Kingdom in Kabul was the United Kingdom's diplomatic mission to Afghanistan. The British first established a diplomatic mission, a legation, in 1922 after the Anglo-Afghan Treaty of 1919. The Viceroy of India George Curzon, 1st Marquess Curzon of Kedleston ordered that a large and opulent compound be constructed and this was completed in 1927. The legation was withdrawn in the Kabul Airlift as a result of the 1928-29 civil war but was re-established in 1930. The legation became an embassy in 1948 but this was withdrawn in 1989 following the Soviet withdrawal from Afghanistan. The embassy compound was handed over to Pakistan in 1994. Following the 2001 United States invasion of Afghanistan an embassy was re-established at a new site in the Wazir Akbar Khan District. The embassy, on the edge of Kabul's secure zone, was considered vulnerable to attack in 2018 and consideration was given to a new site, but did not proceed. Following the start of the 2021 withdrawal of foreign troops from Afghanistan there has been speculation that the embassy might close.
 Since August 2021, the embassy has been operating from Doha, Qatar.
 The United Kingdom established full diplomatic relations with Afghanistan after the Anglo-Afghan Treaty of 1919, which included for an exchange of diplomatic missions. Before this the British government maintained only an agent in Kabul. Under the treaty, which ended the Third Anglo-Afghan War, Britain recognised Afghanistan's independence. The treaty also ended British payments to the Afghan king in return for control over foreign policy. The funds were instead used to establish a British diplomatic mission in Kabul; as Afghanistan was considered a minor nation this would be a legation rather than an embassy. Because of the historic relationship between British India and Afghanistan the legation came under the purview of the India Office rather than the Foreign Office. In 1921 the Secretary of State for Foreign Affairs George Curzon, 1st Marquess Curzon of Kedleston declared that the compound "should be one of the finest Residences in Asia".
 The legation compound was completed in 1927, though the mission had been established in 1922 and began operating from the compound in 1926. The legation was caught in the crossfire between a loyalist and rebel army in the 1928-29 civil war. The legation staff were withdrawn in the Kabul Airlift, but the mission was re-established in 1930 when diplomatic relations were opened with the government of Mohammed Nadir Shah.
 Following Indian independence in 1947 legation staff had to choose to transfer to the British, Indian or Pakistani civil service. In 1948 the legation formally became an embassy. It became known for its luxury and was described as "a 25-acre (10 ha) haven of Edwardian comfort and security".
 The embassy remained in Afghanistan during the Soviet–Afghan War (which began in 1979) but was withdrawn in January 1989 when Soviet troops began to be withdrawn from the country. The embassy and those of the US, France, Italy and Japan were withdrawn as the security situation deteriorated. British embassy staff and their families recalled walking the 3 miles (4.8 km) to the airport "through enemy lines" to catch flights to India. The closure of foreign embassies effectively withdrew diplomatic recognition from Afghan president Mohammad Najibullah who remained in power, with Soviet and then Russian backing, until 1992 when the mujahedeen took Kabul. The withdrawal was criticised by some commentators at the time as "wholly political, and contrary to the realistic and non-political traditions of British diplomacy". Some nations, such as India and Pakistan, maintained embassies in the Islamic State of Afghanistan.
 The British government handed the embassy compound over to Pakistan in 1994 and it became the embassy of that country. The embassy was attacked in 1995 by 5,000 Afghans protesting Pakistani involvement in Afghan affairs. The Pakistani embassy was withdrawn shortly afterwards.
 A British embassy in Kabul was re-established following the 2001 United States invasion of Afghanistan. The British government began negotiations to purchase the former legation compound but failed to reach an agreement with Pakistan. The Pakistani embassy was reopened in the former minister's residence of the legation compound in 2012. The British government secured a new site in the city's Wazir Akbar Khan District, which became a secure zone with offices for many Afghan and foreign institutions. The British embassy is located close to the edge of the secure zone. Newly arrived embassy staff were surprised to find that the pre-1989 ambassadorial china, crystal and silver were safe, having been kept secure by two former embassy caretakers.
 On 27 November 2014, an armoured convoy of the embassy staff was targeted in a bomb attack around 3 miles (4.8 km) east of the embassy. Six people were killed, including a British G4S embassy security guard and two Afghan embassy employees; a further British security guard was wounded. In 2018, following a large bomb attack on nearby embassies, the British government considered relocating the embassy as the current site was thought vulnerable to attack. A former Afghan Transport Ministry office near the US embassy was investigated but it was decided not to relocate. On 2 April 2020, a British G4S embassy security guard was found dead on its grounds, with traces of drugs in his system.
 The current ambassador is Sir Laurie Bristow. The British Council in Afghanistan is co-located with the embassy.
 Following the start of the 2021 withdrawal of foreign troops from Afghanistan, there was considerable discussion in Afghanistan and the foreign press over whether the British embassy might close. The Australian and Belgian embassies had closed the same year over security concerns. As of 2 July 2021, security at the site continued to be provided by private contractors, though there was speculation that these would soon be replaced by British Army personnel, as had happened at the US embassy. 
 Following the fall of Kabul to Taliban forces on 15 August 2021, 600 troops were deployed to help evacuate embassy personnel, local Afghan staff, and approximately 4,000 British nationals stranded in Afghanistan. Ambassador Bristow and a reduced diplomatic staff will remain in the country. Defence Secretary Ben Wallace stated that the embassy would be moved to a safer location. Subsequently, the embassy relocated to Kabul International Airport where a skeleton staff continued to operate until 29 August when operations moved to Doha.
 Some 160 GardaWorld employees worked at the embassy and most applied for the Ministry of Defence-run Afghan relocations and assistance policy (Arap) all except 21 translators were rejected in July 2021. The workers were told they were ineligible due to working for a contractor rather than direct for the British government. In mid-August, the GardaWorld contract was demobilised. Several of the guards were informed of this over the phone.