Two people including a five-year-old girl have been injured after a man opened fire on a German refugee shelter with an air rifle.

A 21-year-old man has been accused of shooting at the shelter from his third floor apartment, only 40 meters away from the camp in western Germany.

Police searched the man’s apartment and reportedly removed the air rifle and munitions.

The suspect was not arrested as “there were no ground for arrest”, a police spokeswoman said.

The police confirmed the investigation was ongoing, adding “it is unclear if the act was politically motivated.”

Excavators tear down a burnt down hall at Messe Duesseldorf, Germany, 8 June 2016. (EPA)

The mother of the Macedonian girl initially thought someone had thrown a stone at her daughter.

It was not until a witness saw the suspect shooting the second victim, an 18-year old Syrian, in the leg that it became clear what happened.

More than 1 million migrants have reached Europe since 2015, which had resulted in an increase in hate crimes against refugees.

In Germany, just under 1,000 far right offences were recorded targeting refugees in shelters in 2015, which is a fivefold increase.

In January, a hand grenade was thrown into a refugee shelter following the Cologne attacks. Police said it was pure luck the grenade did not detonate.