The European Parliament has voted in favour of controversial new legislation which gives US authorities access to information about airline passengers.

MEPs meeting in Strasbourg decided to allow the US Department of Homeland Security to see data routinely collected by airlines including passenger names, addresses, credit card details and seat numbers.

Sensitive data such as a person's religious beliefs, sexual orientation and racial origin could also be used in "exceptional" circumstances.

The EU-US Passenger Name Record (PNR) agreement was adopted with 409 votes in favour, 226 against and 33 abstentions. A proposal to refer the agreement to the European Court of Justice was rejected by MEPs.

The deal covers all flights to or from the US and under the agreement US authorities can retain the data for up to 15 years.

While proponents of the legislation believe it is essential in order to counter terrorism and serious transnational crimes, opponents claim the data retention period is too long and that data protection safeguards in the agreement are not up to EU standards.

The European commission's own lawyers said last year that the agreement is unlawful and expressed "grave doubts" that the deal would comply with the fundamental right to data protection.

The agreement, which has been held up for two years due to privacy concerns, replaces another deal applied provisionally since 2007.

Under the new agreement, PNR data will be stored by the US authorities in an active data base for up to five years. After the first six months, all information which could be used to identify a passenger would be "depersonalised", meaning that data such as the passenger's name or their contact information would be masked out.

After the first five years, the data would then be moved to a "dormant database" for up to 10 years, with stricter access requirements for US officials. Thereafter, the agreement says, data would be fully "anonymised" by deleting all information which could serve to identify the passenger.

US authorities had said they intended to negotiate agreements with individual countries if the European Parliament voted against today's agreement.