By Stephanie Hegarty
BBC World Service
Nigeria's government has condemned reports that its citizens, and those of other African countries, have been stopped from leaving war-torn Ukraine.
Isaac, a Nigerian man trying to get into Poland, said border staff told him they were "not tending to Africans".
"We've been chased back, we've been hit with police armed with sticks," he told the BBC.
South African foreign office official Clayson Monyela also said students had been "badly treated" at the border.
There have also been numerous reports of Ukrainian security officials preventing Africans from catching buses and trains going to the border.
The official visuals of Ukrainians blocking Africans from getting on trains. #AfricansinUkraine pic.twitter.com/hJYpM3LY0A
Osemen, from Nigeria, told the BBC he had tried to get on a train in Lviv to take him to the Polish border but was told only Ukrainians would be allowed on board.
Nigeria's President Muhammadu Buhari said there were about 4,000 Nigerians in Ukraine, mostly students.
He said one group had repeatedly been refused entry to Poland so they travelled back into Ukraine to head for Hungary instead.
"All who flee a conflict situation have the same right to safe passage under the UN Convention, and the colour of their passport or their skin should make no difference," Mr Buhari said in a tweet.
More than 500,000 Ukrainians have managed to flee the Russian invasion so far.
University student Ruqqaya, from Nigeria, was studying medicine in Kharkiv in the east of the country when the city was attacked. She walked for 11 hours overnight before she arrived at the Medyka crossing with Poland.
"When I came here there were black people sleeping on the street," she told the BBC.
She says she was told by armed guards to wait as Ukrainians had to be let through first. She watched busloads of people, whom she described as white, being allowed through the border while only a handful of Africans were selected from the queue. After waiting for many hours, she was finally allowed to cross and made her way to Warsaw to fly back to Nigeria.
Asya, a medical student from Somalia studying in Kyiv, had a similar account. When she finally reached Poland, she said she was told "accommodation at the hotel was only for Ukrainians".
She is now safe in Warsaw, where she's staying in a hotel. In stark contrast to her experience at the border, she's found people in the city to be incredibly kind and welcoming.
All of the African and Asian students she's in touch with have been offered free accommodation. She said the reception had been overwhelming.
The Polish border force told the BBC that everyone fleeing conflict in Ukraine was being welcomed into Poland regardless of nationality. The BBC has tried to contact the Ukrainian border force but has yet to receive a response.
Nigeria's Foreign Minister Geofrey Onyeama said he had spoken with his Ukrainian counterpart Dmytro Kuleba and had been assured that Ukrainian border guards had been given an order to allow all foreigners leaving Ukraine to pass without restrictions.
Nigeria's ministry of foreign affairs has now advised its citizens leaving Ukraine to head for Hungary or Romania, rather than trying to enter Poland.
The Nigerian ambassador to Romania has told the BBC that so far about 200 Nigerians – mostly students – have arrived in the capital Bucharest from Ukraine. Safiya Nuhu said many more were still arriving.
Are you trying to leave Ukraine? Please get in touch if it is safe to do so. Email firstname.lastname@example.org.
Please include a contact number if you are willing to speak to a BBC journalist. You can also get in touch in the following ways:
If you are reading this page and can't see the form you will need to visit the mobile version of the BBC website to submit your question or comment or you can email us at HaveYourSay@bbc.co.uk. Please include your name, age and location with any submission.
Russian shelling prevents evacuations once again – Ukraine
'It's hell, really hell' – Families on foot flee bombs
Why has 'Z' become a Russian pro-war symbol?
With placards and tears, Poles greet refugees like family
Twitter is part of our war effort – Ukraine minister
Ukraine volunteers 'working on autopilot' Video
'I went from prisoner to PhD'
Arena inquiry: Saffie's mum on hearing the truth
Mariupol: Fires, no water, and bodies in the street
Grozny, Aleppo, Ukraine: Russia's answer is firepower
The West fights back against Putin the disruptor
The young Ukrainians battling pro-Russian trolls
What lies behind Putin's invasion?
Panorama reports on the conflict in Ukraine
Janet Devlin: Young, Female, and Addicted
A journey to understand the impact alcohol addiction has on young women in Northern Ireland
Hunting Britain's most wanted criminal
Kevin Parle has been on the run since 2004 – will he ever be brought to justice?
© 2022 BBC. The BBC is not responsible for the content of external sites. Read about our approach to external linking.
Ukraine conflict: Nigeria condemns treatment of Africans – BBC.com
By Stephanie Hegarty