The European Parliament gave final approval on Thursday to an exchange of airline passenger data between security forces in the European Union, ending a stand-off between privacy advocates and those who consider the move crucial to fighting terrorism.
The law on retaining and sharing passenger name records - PNR - had been stalled for years because of opposition within the European Parliament to the blanket collection of such data.
French Interior Minister Bernard Cazeneuve welcomed the deal as a "precious tool" to strengthen European security by making it easier to detect the movements of suspected Islamic militants ahead of time.
Some left-wing groups opposed the measure, arguing that it infringed people's privacy and that security forces should share more existing information instead.
"There is no proof that the mass collection and storage of air passenger data helps in combating terrorism," said Jan Albrecht, a member of parliament from the Greens group.
Thursday's vote paves the way for the final adoption of the law by EU member states.
"PNR is not a silver bullet but countries that have national PNR systems have shown time and again that it is highly effective," Timothy Kirkhope, a European parliamentarian who steered the legislation to adoption, said after the vote.
PNR includes name, travel dates, itinerary, ticket details, contact details, travel agent, means of payment, seat number and baggage information.
Airlines operating flights between the EU and third countries as well as intra-EU flights will transfer the data to national security services who could then share it with their European counterparts.
The data will be retained for five years but, in a gesture to privacy campaigners, will be rendered anonymous after six months of storage.
Many police forces already collect PNR data and many European states share it with each other and with countries outside Europe. But the lack of a common EU system, including data formats, is seen to be weakening European security.
"This is a strong expression of Europe's commitment to fight terrorism and organised crime together through enhanced cooperation and effective intelligence-sharing," EU Commission Vice-President Frans Timmermans and Home Affairs Commissioner Dimitris Avramopoulos said in a joint statement.