European Union lawmakers approved Thursday a scheme to share airline passenger information that nations hope to use to track foreign fighters travelling to and from conflict areas like Syria and who might pose a danger in Europe.

The move ends years of wrangling over how to balance security needs and privacy rights. Lawmakers came under great pressure to adopt the scheme in the wake of the Nov. 13 attacks in Paris that killed 130 and last month’s suicide bombings in Brussels, which left 32 dead.

The so-called Passenger Name Record law was approved at the European Parliament in Strasbourg, France, by 461 votes to 179, with nine abstentions.

“PNR will be a precious tool for boosting the security of European citizens by helping to detect early the movement of jihadi terrorists that take air transport throughout Europe, but also between Europe and other regions of the world, to prevent them taking action,” Interior Minister Bernard Cazeneuve said.

Critics say that many of those linked to the attacks were already known to the authorities, and that the scheme will needlessly collect private information about ordinary citizens, as well as be costly and cumbersome to operate. They say that the 28 EU countries are simply not sharing the information they already have.

Under the scheme, law enforcement agencies in all 28 nations would have access to traveler details gathered by airlines, including names, travel dates, itineraries, and credit card details.

The data will be collected on any flights entering or leaving the EU and on flights between member countries. The information will be kept for five years, but identifying details like name, address and contact details will be masked out after six months to protect people’s identities.

At least 5,000 Europeans are believed to have trained or fought in Syria and Iraq but authorities are struggling to track their movements and prove their activities.

Cazeneuve said the system will improve “the sharing of information between police forces and European intelligence, one of the crucial requirements to enhance our protection against a new and mobile terrorist threat.”

The EU agreed to passenger data deals with the U.S., Canada and Australia years ago but has struggled to finalize one to share data among its member states. The EU scheme was originally proposed in 2007. It spent five years under debate at the assembly.

The member states must now rubber stamp the law, but this is considered a formality.

Raf Casert in Brussels contributed.

Photo Credit: Passport control at Paris' Charles de Gaulle airport. EU nations will soon be sharing some passenger information in an attempt to prevent the movement of possible criminals. Bobby Hidy / Flickr