BENTIU (Reuters) - In the chaos of South Sudan’s civil war, it took three years for Nyagonga Machul to find her lost children.

Nyagonga Machul, 38 converses with her daughters Nyameer Mario, 6 (L) and Nyawan Mario, 4, in their home at the United Nations Mission in South Sudan (UNMISS) Protection of Civilian site (CoP) in Juba, South Sudan, February 15, 2017. REUTERS/Siegfried Modola

Machul had traveled from her village to the capital when President Salva Kiir, an ethnic Dinka, fired his deputy Riek Machar, a Nuer, in 2013. The dismissal triggered a civil war in the world’s newest nation that has increasingly been fought along ethnic lines.

Machul found herself cut off from her son Nhial, now aged 14 and the protector of the family; 10-year-old Ruai and 8-year-old Machiey, brothers who love board games and swimming; 6-year-old Nyameer with her shy smile; and Nyawan, now four but then the much-loved baby.

For years, Machul prayed for news. In December, she heard her children were alive - but far away in Bentiu, the northern gateway to the nation’s oil fields. More than a thousand 1,000 km (620 miles) of battlefield stretched between them.

Machul had left the children with their grandmother, but one night gunmen had attacked their village.

“I was in bed sleeping. All of a sudden I heard the sound of gunshots, then people shouting, screaming,” said Nhial.

The panicked children scattered and hid near the river Nile. Wandering back, they found each other, but not their grandmother. They decided to flee.

Slideshow ( 22 images )

They walked through swamps, in chest-deep water infested with snakes and crocodiles. They begged food from families with little to spare.

Then a former neighbor, Nyabika Temdor, took them in, camping with them on a tiny island in the Nile. But gunmen struck again and they ran.

“I had to pay someone to carry the little ones, as they couldn’t walk,” Temdor said.

After four days, they reached a camp for displaced families in Bentiu. The sprawling settlement of 120,000 people is bordered by barbed wire and watchtowers.

That is where CINA found them. A local organization supported by UNICEF, case workers painstakingly trace separated families. They enter the names of lost children into a UNICEF supported database that holds nearly 15,000 names.

Having a parent vastly improves the long-term chances of a child’s survival, said Marianna Zaichykova, a spokeswoman for UNICEF. But the program is chronically underfunded.

Last year, reunifications dropped by 50 percent because there was not enough money to trace families, Zaichykova said.

Machul was lucky. UNICEF arranged for the children to fly to Juba this week. Their mother waited for them, in a tent made of sticks and plastic that looked just like the one they left in Bentiu.

She dappled drops of water on her children’s faces in a traditional blessing. Her friends began to sing. And then she opened her arms for her children.

“God has answered my prayers,” she said. “I am so happy.”

For a Wider Image photo essay of the story, click reut.rs/2kVBzp0