Besides being of great scientific interest, near-Earth objects represent a well-founded threat to life on our planet. Nonetheless, up to now there has been no concerted international plan on how to deal with the impact threat, and how to prepare and implement mitigation measures. The NEOShield project is funded by the European Commission to address such issues, to investigate the feasibility of techniques to prevent a potentially catastrophic impact on Earth by an asteroid or a comet, and to develop detailed designs of appropriate space missions to test deflection techniques. In this work we present and discuss the scientific and strategic aspects of the asteroid impact threat, highlighting the necessary steps so as to be ready to react to future hazardous objects.