Beauty of a photo - great capture of a stunning butterfly!
Going by your location in the UK its not a Western Tiger Swallowtail (Papilio rutulus), but a Swallowtail (Papilio machaon). That is provided you saw it in the UK and its not part of a captive collection.
If its a wild seen one then its a very rare butterfly to see in the UK. The native population is restricted to Norfolk (due to that being where its primary larval food plant, Milk-parsley, is located). If you've seen it elsewhere then its an even rarer potential migrant form Europe.
If you want a good reference book the Collins Butterfly Guide is a well written book with clear illustrations of each species of butterfly over Britain and Europe
That would certainly make it a Swallowtail (Papilio machaon) as they are distributed over a wide area of Europe, including Spain. Still a rare butterfly to see so a great experience! (suffered huge population reductions, likely as a result of changing farming practices)