You can't buy duty free from Spain if you have only travelled there from the UK because you haven't left the European Europe. However you can buy cigarettes from Spain with duty paid and bring them back for personal consumption. The guideline is that any more than 800 cigarettes is likely to raise questions. See this link http://www.hmrc.gov.u...riving/arrivingeu.htm
To make it more difficult, the Canary Islands are not regarded as being EU territory as far as these allowances are concerned.
Since October 1st, the limit is reduced to 800 cigarettes if coming from mainland Spain (or anywhere else in the EU). From the Canaries and any non-EU area it's 200.