Yes. They even have land-borders.
The Atlas mountains in Morocco are close to Spain.
Morocco
Morocco, Spain, and France.
Morocco is south of Spain in Africa.
The Strait of Gibraltar separates Spain from Morocco.
Spain and Morocco
Morocco was split between France and Spain.
Morocco
Jordan, Morocco and Spain.
No African country borders Spain. Morocco is separated by sea at the Straits of Gibraltar from Spain, so it is close to it.
Morocco, Spain, and France.
The straight of Gibraltar separates Spain from Africa meaning its SPAIN