Nigerian medical student Oduola Adebowale said he and some friends were trying to get on a train to flee Ukraine when the soldiers pointed guns at them and ordered them back.
The Ukrainian troops told him they were only letting pregnant woman on the service from the city of Lviv to the Polish border, but he said he saw them stop some pregnant African women from getting on board.
"When we asked why they were doing this, the soldiers pointed guns at us, endangering our lives," he told Reuters days later after he finally managed to complete his journey and landed at Nigeria's Abuja airport on Friday.
Scores of foreign students have echoed his complaints in social media posts, saying they were treated badly as they queued up with the crowds trying to escape Russia's invasion.
Reuters could not independently verify the accounts of Asian and African students being pulled off trains, held up at borders and pushed to the back of long lines.
Ukraine's national police and state border service did not immediately respond to requests for comment on reports that Reuters had received from refugees.
But the African Union said this week it was disturbed by what it had heard and the U.N. refugee agency said it had urged authorities in countries neighbouring Ukraine to open their borders to African citizens. read more
Ukraine's Foreign Minister, Dmytro Kuleba, said on Wednesday authorities had sent up a hotline for African and Asian students looking for help in getting out. "We are working intensively to ensure their safety & speed up their passage," he tweeted.Adebowale did finally manage to get away, after waiting for hours for a train at Lviv then getting permission to travel to Romania.
He was among 415 Nigerian students who flew into Abuja on a Nigerian government-chartered flight from Bucharest. The government has also sent planes to collect Nigerians from Poland and Hungary.
One student still waiting in Warsaw told Reuters via Zoom he and two fellow Nigerians were pulled off a train they had boarded in Ukraine's capital Kyiv.
"We were already in our cabin, and they called police on us. The police came and dragged us out. Police (said) that 'this is specifically for Ukrainians'," Alexander Orah, a 25-year-old management student, said.
Reuters could also not independently confirm his account.
Orah said he and his friends were eventually allowed to board a train to Medyka, on the border with Poland, but then met guards who told them that Africans, South Asians and Arabs had to use a different crossing into Romania.
When the students refused, he said the guards put up barricades to stop them crossing while allowing white people to leave. When the growing crowd began to move forward, a soldier pointed a gun at them, he said.
"He cocked his gun and stood in a shooting position, so we raised our hands up and started telling him, 'We are students; we just want to go home'." Orah eventually made to the Polish capital and started looking for his next exit.