I photographed this near Madrid last summer and I'm having trouble identifying it.
I thought maybe a sawfly, but then I noticed the three white spots on the thorax. Last time I found white spots - I thought they were on an ant - it turned out to be a wasp, so male velvet ant is also on my list of possible suspects. Judging from the focal length I used, I estimate the length to be 1.5 - 2 cms.
I don't see the the large basal segment on the antennae (scape), typical of ants.
There is a superficial resemblance to:
- Lygaeidae (in the Heteroptera), but the number of antennae segments is wrong (bugs have fewer).
- Plecoptera (stone flies) (not all species have cerci (tails)), but the venation is wrong (lacks the double-ladder typcial of most families of stonefly)
So I think you are on the right line with wasp (hymenoptera); venation, antennae, etc. look right.
Anoplius has similarities; try that and other genera in the Pompilidae.
(Sorry, I don't have good resources on Spaish wasps)
Thanks for the suggestion. However, my insect guide says the Ichneumons have long antennae of at least 16 segments. I realise it's difficult to count these but it looks to me like only 7 (maybe 8 if the final segment is in fact two).
The wing seems to be transparent except for a white and black spot on the forwards edges behind the rear legs. Don't know it that helps.
You were right all along: it is a Sawfly, and it must be one of the Tenthredinidae. Please follow the link below to compare with a similar image (although it's not the same species, I believe it's the same genus).
Just for fun I'm attaching here a comparison of your photo and that one.