Fazi Tamou, a refugee from Syria, holds his baby daughter Rezil, born in Germany, under a decoration that reads: 'Hello Springtime' in the cafeteria at a shelter for refugees and migrants in Marienfelde district on May 3, 2017 in Berlin, Germany. Sean Gallup/Getty Images Up to 700 men in Berlin are claiming to be the fathers of refugees’ babies in exchange for cash, German prosecutors alleged Tuesday.

According to the German broadcaster rbb, pregnant refugees from Vietnam, Africa and Eastern Europe are applying for asylum in Germany.

To help this process along, they are paying up to 5,000 euros, or roughly $5,600, to German men to claim they are the father of their baby.

That would automatically make the baby a German (and EU) citizen at birth, and allow the mother to stay in the country, incidentally gaining access to welfare benefits. But the men shirk responsibility for the child after birth, prosecutors say.

It looks unseemly, but it is legal under German law. And thanks to a brand-new European court ruling, people who are not EU citizens but who are the parents of an EU citizen are considered to have a legal right to residence, giving them a way to bypass the immigration system in some cases.

“We are talking about a large number of cases which we come across every month,” said Berlin prosecutor Martin Steltner. “In some cases we have people who have claimed fatherhood for over ten babies.”

According to prosecutors, most of the men involved in the scheme are unemployed. Rbb found that one 28-year-old German whose Facebook account shows he sympathizes with Germany’s neo-Nazi party claimed paternity for a Vietnamese child.

In another case, rbb discovered 70 Vietnamese women living in one house who had paid for a German man to claim paternity of their child. Prosecutors say that the scheme is used across the country.

However, there is currently nothing law enforcement can do to stop the practice. Claiming paternity of a child, whether or not the man is the baby’s father, is legal under German law. And there are no prohibitions against paying someone to claim that he is a child’s parent.

“For this reason, we don’t have the legal means to investigate these cases,” Steltner told rbb.

He said that lawmakers across the country are currently working to close the loophole.