A 26-year-old Eritrean national became the victim of a "xenophobic" attack when a 55-year-old German man shot him in the stomach from his car before shooting himself in the head, according to prosecutors.

A spokesman for the Frankfurt prosecutor's office said that the perpetrator had been acting out of racist hatred when he shot the Eritrean man in the town of Waechtersbach in the central state of Hesse late Monday.

The 26-year-old seems to have been a random victim, the spokesman added on Tuesday.

Investigators have not been able to link the shooter to any particular right-wing extremist group and the reasons he subsequently killed himself with a shot to the head have yet to be determined.

The spokesman said that two semi-automatic weapons were found in the shooter's car and further weapons - all owned legally - were found in a subsequent raid on the perpetrator's house.

The victim was brought to the hospital but his condition is now stable, according to local media reports.