The 3 January accident which killed 148 people "would very probably not have happened if this directive (EU law) has been put in place," said EU transport commissioner Loyola de Palacio on Wednesday.
The commissioner, speaking after an accord was reached late on Tuesday with EU governments and the European Parliament, noted that the law had been under discussion since 1997, but had been held up for five years by a dispute between Spain and Britain about the airport in the British territory of Gibraltar.
The new law will notably require that EU member states carry out safety checks on any non-European aircraft if there is suspicion that it does not meet international security standards.
If any European country bans an airline it is then obliged to inform Brussels, which can take measures to extend that ban EU-wide.
In addition Brussels will publish an annual report on all safety checks carried out in the EU, to give both the industry and travellers information on problems by naming airlines.
Palacio meanwhile said the European Commission might propose setting up a blacklist of carriers banned from EU airports, although this was not a formal part of the new directive.
Loopholes in communication were exposed after the Egyptian crash involving Flash Airlines, when it emerged that Swiss authorities had banned the carrier since 2002 due to safety problems detected during spot checks.
The new EU law will also apply to non-EU countries like Switzerland and Norway.