Three Nigerian students, Joseph, Eric and Francis, were among the tens of thousands of people who crossed from Ukraine into Poland on Monday.
Speaking to DW's correspondent at the Polish border town of Korczowa, the three said their journey through Ukraine had been made even more difficult because of their skin color.
"There is a lot of discrimination going on there," Joseph, a computer engineering student told DW. "We actually had to beg people to take us to the border so we could find a way to escape."
They are not alone in their complaints. A number of Africans trying to flee Ukraine after Russia invaded last Thursday say they have had problems getting buses or trains to Ukraine's borders because they were black.
Complaints that Ukrainians given priority
Many refugees arrive at Ukrainian border posts on foot, often after walking significant distances through wintry conditions.
Some say that once they arrive at border crossings, Ukrainian border guards are prioritizing Ukrainians and sending others, such as people from African countries, to the back of the queue, some of which stretch for kilometers.
That's the experience of Kouadio Simeon from the Ivory Coast.
Simeon, a recent graduate who had been studying in the heavily bombed northeastern city of Kharkiv, told DW that he and friends had traveled more than 1,000 kilometers (620 miles) west through the country to the Ukrainian city of Lviv, about 75 kilometers from the border to Poland.
From there, he said, they managed to get on a bus, but it only drove them about a dozen kilometers out of town.
"Then we walked more than 65 kilometers in very cold temperatures," he said.
When they arrived, Ukrainian officials didn't allow them through to the Polish border post.
"The situation near the Polish border is very difficult," Simeon said. "We arrived today, but foreigners are not allowed to cross the border, meaning we will stay here in the cold," he added.
The area around Lviv had a maximum temperature of 2 degrees Celsius (36 F) on Monday.
South Africa's foreign ministry spokesperson, Clayson Monyela, has also tweeted that South African students had been having problems getting across the border, saying they were "treated badly."
Chaos at the border
However, with such a mass of refugees overwhelming Ukrainian border crossings, Serge Nyangi, who helps Congolese students access bursaries to study in Ukraine, told DW he believes accusations of racism are exaggerated.
"There are people trying to climb over the barriers, some are fighting with guards. If you see what is happening there, you would know it’s impossible for guards to choose who to let through," he said in a telephone interview on Monday from Ukraine.
Manuel Assuncao, an Angolan student in Ukraine, said he believes part of the problem was the general chaos within the country, with so many people fleeing.
"We watched tanks going by and bombs falling. It's normal for people to be tense. The Ukrainians allowed Ukrainians to pass because there was confusion," he told DW on Monday.
Russia's invasion has triggered the biggest displacement of people in Europe since the end of World War Two, with the United Nations estimating that more than 500,000 have fled the country in the five days since President Vladimir Putin ordered troops into Ukraine.
Happy to be in Poland
Other African students have passed the border with little problems, although the waits have still been long because of the queues.
Sarah Ajifa Idachaba, a 19-year-old Nigerian medical student told DW that she and her older sister, who was also studying medicine in Ukraine, had managed to escape the capital, Kyiv, and had arrived safely in Poland on Sunday.
"During the journey, it was okay until we got to the Ukrainian border. There was a long queue, and we spent a whole day at the border," Idachaba said. "We had our fears and expectations because people who came before us had told us that they were racially profiled and not allowed to go through."
But, upon alighting from the bus and going through passport control, the two students were allowed to continue to the Polish border, she said.
When Russia invaded on Thursday, Idachaba told DW that she and her older sister, who was also studying in Ukraine, were "in a panic" because they didn't know how they would be able to leave the country and start making their way home.
Nearly a quarter of the more than 75,000 foreigners studying in Ukraine are African — with the largest numbers coming from Morocco, Egypt, Nigeria and Ghana. Many are attracted by the country's good technical and medical schools combined with relatively low fees.
EU: All refugees from Ukraine welcome
Ukraine has a visa-free regime with neighboring EU countries, meaning that Ukrainians can pass the borders without having to hold a valid visa or additional documentation.
This has made it easy for Ukrainians fleeing the Russian invasion to leave.
Normally, people from African nations have to apply for a Schengen visa to enter EU member states such as Poland, Romania and Hungary.
The European commissioner for home affairs, Ylva Johansson, has made it clear that the borders were also open to people from third countries who lived in Ukraine and wanted to travel onward to their home countries.
"Those people must be helped," Johansson said. "Moreover, those in need of protection in the EU can also apply for asylum."
The Polish government has issued several tweets stating that it is accepting all refugees fleeing war-hit Ukraine regardless of their nationality.
Waiting for help
Idachaba and her sister are just hoping to soon be able to travel home to Nigeria.
She said little aid has come from the Nigerian government so far.
"We are footing our bills, paying for our accommodation only because the arrangements made by the Nigerian embassy [in Berlin] weren't sustainable," she said.
"Luckily for us, we were able to find affordable accommodation. We are now waiting for our flights to Nigeria this week," she said.
This article was updated on March 1, 2022 to include further reactions of Africans in Ukraine. Max Zander in Korczowa, Poland, Amós Fernando, Etienne Gatanazi and Cai Nebe contributed to this article.
Edited by: Kate Hairsine