In 1967, the Soviet Union immediately recognized South Yemen after it gained independence from Britain. In 1969, South Yemen became the first and only avowedly Communist nation in the Middle East. Unaccepted by Muslim nations in the region, South Yemen relied on aid from Communist nations and allowed the Soviets to keep naval bases in the country. In 1972, after a war broke out between the two neighboring Yemen states, the Yemen Arab Republic and South Yemen agreed to eventually unify. In October 1979, the Soviet Union and South Yemen officially signed a Treaty of Friendship and Cooperation. Despite the aid it now received from the United States following a brief spat with South Yemen between 1978 and 1979, the Yemen Arab Republic would not break with the Soviets and later renewed its Treaty of Friendship and Cooperation with the USSR in October 1984.