Spain was the last country to join NATO once its democratic restoration gained enough momentum following the Dictator Franco's death in 1975. A national referendum voted to joining NATO in 1982, even though it was opposed by a strong socialist opposition party, which came into government later that year.
Spain has fractious relationships with the United Kingdom over Gibraltar, and Portugal over the Savage Islands and the town of Olivenza on the border between the two countries. Other NATO countries have deep seated issues over Spain's fascist history which required significant work to overcome during its integration with the military alliance. Close relations with the US and France however, counterbalanced these issues. A major US fleet base at Rota Spain and air facilities in the Canary Islands ensure continued US support.
Other territorial disputes with Morocco have a minor impact on the Spanish Military, in particular Perejil Island in the Strait of Gibraltar, several other small islands and the Spanish held territories of Ceuta and Melilla.