There are international trains to Spain from Portugal and France and vice versa. Most major cities in Spain have direct rail access to most major cities in Europe.
The main rail crossing into Spain cross the French-Spanish border along the Mediterranean coast and via the Basque Country. Another minor rail route runs inland across the Pyrenees from Latour-de-Carol to Barcelona. From Portugal, the main line runs from Lisbon across Extremadura to Madrid.
Direct trains go from Barcelona to Paris, Geneva, ZÃ¼rich, Milan and Turin, and from Madrid to Paris as well. Check the Spanish Railway website for details on international train travelling.