Hi Sharon2,
Yes.
You would need to claim it back, if the pension was a non UK government pension.
You will need to download and print off the DT individual UK / Spain form at
Double Taxation: UK - Spain (Form Spain-Individual).
Please complete the form, declaring your pensions / annuities, sign and date it.
Then send the form to your local Spanish Tax Office.
They will return the validated form to you, which you send to HMRC (address is on the front page of the form) along with your 'Residencia Fiscal En Espana Convenio'.
We can then arrange for the pension payer to refund any tax deducted.
Thank you.