The Government of the United Kingdom maintains intelligence agencies within several different government departments. The agencies are responsible for collecting and producing foreign and domestic intelligence, providing military intelligence, performing espionage and counter-espionage. Their intelligence assessments contribute to the conduct of the foreign relations of the United Kingdom, maintaining the national security of the United Kingdom, military planning and law enforcement in the United Kingdom. The three main agencies are the Secret Intelligence Service (MI6), the Security Service (MI5), and the Government Communications Headquarters (GCHQ).
The history of the organisations goes back to the 19th century. The decryption of the Zimmermann Telegram in 1917 was described as the most significant intelligence triumph for Britain during World War I, and one of the earliest occasions on which a piece of signals intelligence influenced world events. During the Second World War and afterwards, many observers regarded Ultra as immensely valuable to the Allies of World War II. In the post-war period, intelligence cooperation between the United Kingdom and the United States became the cornerstone of Western intelligence gathering and the "Special Relationship" between the UK and the USA.