France's parliament has passed a new bill that introduces tighter curbs on foreigners hoping to join relatives in France - including possible DNA tests.
Socialists say human rights not genetics should define the law
The controversial bill was passed in both the country's National Assembly and in the Senate.
Supporters say it will speed up the process for genuine applicants and cite similar laws in other European nations.
Critics have attacked the law as racist and questioned the use of genetics as a basis for being allowed into France.
The bill passed by 282 votes to 235 in the lower National Assembly and by 185 votes to 136 in the upper Senate.
It offers prospective migrants DNA tests to prove their link to relatives already living in France.
It also requires hopeful incomers to take a language test and show they are familiar with French values.
Relatives of prospective immigrants living in France must show they have adequate income to support the newcomer.
The bill has been hugely controversial, prompting thousands of people to take part in street protests across the country last weekend.
The plan to offer DNA testing to would-be migrants has been the most controversial element of the new law, drawing criticism from civil rights groups and several African leaders.
Immigration Minister Brice Hortefeux dismissed the fears, saying 12 other European countries - including Denmark and the Netherlands - already had similar DNA testing procedures.
French opponents of the tests say they are reminiscent of the country's policies under Nazi occupation, which discriminated against the Jews.
The bill's proposals for DNA testing have already been diluted in response to some of the criticism.
Under the modified version passed by parliament, DNA tests will only be used in cases where children are applying to join mothers in France.
The tests will be voluntary rather than mandatory and will be paid for by the French government rather than by the migrant.
Opponents of the bill say genetic testing is nonetheless likely to be regarded as mandatory for immigrants from certain poorer countries.
Civil rights groups warn that the DNA tests offered to prospective immigrants may effectively equate them with criminals, whose genetic records are already kept on police databases.
The opposition Socialists say human rights principles, not genetics, should determine who can get visas, and vowed to challenge the measure in the Constitutional Court.
Socialist deputy Arnaud Montebourg said: "This law violates the fundamental principles of the republic which do not define family and affiliation by biology."
Communist lawmaker Patrick Braouezec said the law was "institutionalising xenophobia".
An opinion poll in the daily Le Parisien showed 49% supported the bill and 43% were opposed.