VENTIMIGLIA, Italy — The train that rumbles along the steep French-Italian coast, shuttling tourists from one picturesque town to another, did not take Abdulhakim Kabeto very far. After it crossed over from Italy, police officers in France stopped him at the first station in the country and returned him to the border.

Mr. Kabeto, a 22-year-old Ethiopian who was five months into a grueling journey to Europe, said he never expected that his travels through Sudan and Libya, and across the Mediterranean Sea, would then stall in an Italian town just miles from the French border.

Speaking recently outside a Red Cross center in Ventimiglia, he said he had made five attempts to reach France, on his way to Britain, but had been stuck in Italy for several weeks.

“If you go by bus, by foot, by train, it’s the same police on the other side,” he said, crouching in the shade to escape the heat. “And they send you back.”