A teenage Afghan migrant - who arrived in Germany as an unaccompanied minor last year - has been taken into custody on suspicion of the rape and killing of a 19-year-old university student.

Prosecutor Dieter Inhofer, in Freiburg, south-west Germany, said on Saturday that the 17-year-old asylum seeker was identified as a suspect based on traffic video from near the crime scene.

Inhofer told the dpa news agency that DNA evidence tied the boy to the crime scene. He was living in the area with a family.

The student vanished on her way home from a party early on October 16. Her body was found in a river later that day.

The suspect has not made a statement.

Authorities are trying to determine if he and the young woman knew each other.