Macedonian police say a migrant walking along railroad tracks on the northern border with Serbia has died after being hit by a freight train.

Macedonia is a major transit route for migrants from the Middle East, Asia and Africa heading from Greece to more prosperous European Union countries. Almost 38,000 migrants have been registered passing through Macedonia in the last month.

The migrant died Monday while being transported to a hospital in the capital, Skopje, becoming the 29th person to die on train tracks in nearly two years.

Police also said they detained three Syrians on Sunday near the southern border with Greece, when a crowd of migrants threw stones, bottles and shoes at police attempting to restore order at the Gevgelija railway station where hundreds attempt to board Serbia-bound trains.