The European Parliament has approved the sharing of passenger name records on all flights to and from the EU.
The new joint system for police and justice officials is being introduced to combat terrorism.
The law was first approved in 2011 but has taken five years to be passed due to privacy laws.
EU countries will have two years to turn it into national law.
The European Commission welcomed the ruling. “The data in question is already collected by airlines but the new legislation sets out detailed rules for national authorities to access it when tackling serious crime,” it said in a statement.
The Commission added: “The atrocious terrorist attacks in Paris on 13 November last year and Brussels on 22 March showed once more that Europe needs to scale up its common response to terrorism and take concrete actions to fight it.
“The EU PNR Directive will be an important contribution to our common response.
“The EU PNR Directive will improve the safety and security of our citizens, while also including robust privacy and data protection safeguards ensuring full compliance with the right to data protection.
“The processing of PNR data is an effective and much needed tool for Europe to prevent and fight terrorist activity and serious crime.”
The information collected by authorities includes travel dates, itineraries, ticket information, contact details, the travel agent through which the flight was booked, means of payment used, seat number and baggage information.