A wide-ranging anti-terror operation was under way in Spain on Friday after police killed five men wearing fake suicide belts in a town south of Barcelona, hours after a van mowed down dozens of people in the heart of the city.