Below you can see a great map of the Baghdad Pact (CENTO). The Baghdad Pact was an alliance created by the British in 1955, together with Turkey, Iraq, Iran and Pakistan. It was meant to form a wall between the oil of the Persian Gulf and the Soviet Union.
Map The Baghdad Pact
However in 1958 the socialists managed to overturn the Iraqi King, who was also a British ally, they established a socialist dictatorship, and they became Soviet allies. However the Baghdad Pact survived the loss of Iraq, because Iran and Turkey are neighboring countries, and therefore the “wall” between the oil of the Persian Gulf and the Soviet Union was not broken.
The alliance was terminated in 1979, when the Iranian Islamists took control of Iran, overturning the Iranian King, who was also a close American ally. The Iranians, like the Iraqis, nationalized the Western oil companies. At the time, the Russians, contrary to what is happening today, were not selling oil to NATO countries, and therefore their relations with the socialist dictators of the Middle East and Northern Africa were very easy.