Good question Puna. The shop packed the sword in a special box. The folks at Barajas are so used to tourists carrying around these "sword boxes" that they just scan the box and then check the sword directly onto the plane for you. They did look it over carefully first.

There was no hassle and the security people were courteous, which seems to be the case throughout Spain.