More than 500 male students and staff at a French school will undergo DNA tests from Monday in a bid to discover who attacked a 16-year-old girl in a dark school toilet.

The tests, a first in a French school, will end on Wednesday and target 475 students, 31 teachers and 21 others present on the premises on 30 September last year when the alleged rape happened.

The schoolgirl was assaulted in the private Catholic Fenelon-Notre-Dame high school in the southwestern Atlantic port city of La Rochelle.

The attack took place after the light from an automatic time switch went off and she was unable to give the physical details of her attacker.

There are a total of 1,200 students in the school. 

The cost of the operation will be around €5,000 and saliva swabs will be taken and matched with DNA found on the girl's clothes.

DNA from her clothes had tested negatively when matched with those of her family and close friends. The results are due out in a month.

Isabelle Pagenelle, the prosecutor of La Rochelle, said both parental and individual authorisation was necessary for minors undertaking the test.

She said there would be no forced DNA testing but added that "those saying no can become potential suspects who may be detained."

Results not connected with the rape will be destroyed, Ms Pagenelle said, adding that the tests were necessary to prevent further assaults and make the school safer.