PASSAU, Germany — Reza Mohammadi lost his parents in a forest in Macedonia. Or Serbia. He does not remember. What he does remember is that it was raining: Thick mud clung to his shoes and weighed down his 7-year-old legs.

His family had fled from Afghanistan to Iran, then to Turkey. They had boarded a rubber boat to Greece and were rescued by the coast guard before moving on, mostly by foot, toward Germany.

That rainy night near the Macedonian-Serbian border, Reza and his mother, father and two sisters were walking in a group of about two dozen, he recalled. When he realized that his family was no longer behind him, he sat down on a tree stump and waited. There was a commotion farther down the path. Then a shadow emerged from the trees.

“What are you doing?” a man whispered in Dari.

“I am waiting for my parents,” Reza replied.

The man was from Herat Province in western Afghanistan, like Reza’s family. He said the forest was full of police officers. They had arrested several families in the back. It was not safe to stay. The boy took his hand and ran.