The European Parliament has backed sharing airline passenger data across the EU as part of the fight against terrorism.
The European Commission first proposed the so-called Passenger Name Record in 2011.
It marks a five-year battle to get the legislation approved, having being held up over privacy concerns.
The Paris and Brussels attacks have led MEPs to change their mind.
The so-called Passenger Name Record was approved by 416 votes for, to 179 votes against, with nine abstentions.
It will force airlines to share key data, such as travel plans or phone numbers, with EU destination countries.
Officials say this will make it easier to track potential militants but also criminals who smuggle people, drugs or weapons.
“We have adopted an important new tool for fighting terrorists and traffickers. By collecting, sharing and analysing PNR information our intelligence agencies can detect patterns of suspicious behaviour to be followed up,” said Timothy Kirkhope, the British conservative who steered the legislation through the European Parliament.
“PNR is not a silver bullet, but countries that have national PNR systems have shown time and again that it is highly effective,” he added.
EU member states – apart from Denmark, which has an opt-out – now have two years to turn it into national law.