The personal data of millions of passengers who fly between the US and Europe, including credit card details, phone numbers and home addresses, may be stored by the US department of homeland security for 15 years, according to a draft agreement between Washington and Brussels leaked to the Guardian.

The "restricted" draft, which emerged from negotiations between the US and EU, opens the way for passenger data provided to airlines on check-in to be analysed by US automated data-mining and profiling programmes in the name of fighting terrorism, crime and illegal migration. The Americans want to require airlines to supply passenger lists as near complete as possible 96 hours before takeoff, so names can be checked against terrorist and immigration watchlists.

The agreement acknowledges that there will be occasions when people are delayed or prevented from flying because they are wrongly identified as a threat, and gives them the right to petition for judicial review in the US federal court. It also outlines procedures in the event of anticipated data losses or other unauthorised disclosure. The text includes provisions under which "sensitive personal data" – such as ethnic origin, political opinions, and details of health or sex life – can be used in exceptional circumstances where an individual's life could be imperilled.

The 15-year retention period is likely to prove highly controversial as it is three times the five years allowed for in the EU's PNR (passenger name record) regime to cover flights into, out of and within Europe. A period of five and a half years has just been negotiated in a similar agreement with Australia. Germany and France raised concerns this week about the agreement and the unproven necessity for the measure.

Britain has already announced its intention to opt in to the European PNR plan, in which the home secretary, Theresa May, played a key role, and is expected to join the US agreement this summer.

The Home Office minister Damian Green has said: "The power of PNR lies in the fact that by using an automated system and interrogating it intelligently, we are able to sift data quickly and in such a way that it reveals patterns and makes links that would otherwise not be readily apparent."

The text of the draft agreement does not explicitly mention profiling but instead talks of "processing and analysing PNR data".

The US Senate passed a resolution last week saying it "simply could not accept" any watering down by European ministers of data-sharing, describing it as "an important part of our layered defences against terrorism". Senators said it was an important tool in the security agencies' "identifying possible threats before they arrive in our country".

But the European parliament, which would have to approve it, has demanded proof that such a PNR agreement is necessary, and said it should in no circumstances be used for data-mining or profiling.

A provisional agreement on sharing airline passenger data between the EU and the US has been in force since 2007, but has been the subject of an intense civil liberties debate across Europe. This draft agreement appears to give the Americans all they have asked for.

A leaked opinion from the EU council of ministers' legal advisers also warns that the EU's PNR scheme is disproportionate and not in line with privacy requirements under human rights law. The German constitutional court ruled last years that six months was the maximum appropriate period for retaining personal telecommunications data.

The EU-US agreement tries to allay some of these privacy concerns by proposing to "mask" or "depersonalise" the identity of individuals after six months on the homeland security department's active database. The data will be transferred to a dormant database after five years, to be held for a further 10 years. But the agreement allows for the identity of individuals to be restored at any stage by authorised officials in connection with a particular law enforcement operation.

The agreement will not only cover transatlantic flights, but appears to raise the prospect that airlines will have to provide PNR details to Washington for other international flights. It also allows passenger data to be passed to agencies in countries outside the US and Europe.

Jan Philip Albrecht, a German green party member of the European parliament's civil liberties committee, said the agreement in its current form should be rejected. "The planned PNR agreement with the US violates fundamental constitutional principles of European states. Europeans should have the right to protection of their fundamental rights when cooperating with other countries like the US and Australia."

"A blanket retention of personal data for five or even more years is a huge infringement of data protection principles. The mass collection and analysis of PNR data as planned in the new agreements cannot be justified in the view of recent court judgements.

"Especially the untransparent profiling practices in the US are in clear contradiction to the European parliament's demands. In this form, the parliament has to vote the proposals down."

The data to be collected includes 19 separate items relating to each airline passenger, including their billing details, contact numbers, the names of those they are travelling with and how much baggage they have, as well their itinerary.

Airlines are to be required to provide the details up to 96 hours in advance, compared with 72 hours now under the provisional arrangement.