Gunmen in war-ravaged South Sudan have abducted at least 89 boys from their school in oil-rich Upper Nile State, the United Nations says.

The boys - some as young as 13 - were taken while doing their exams and the total number of kidnapped children could be "much higher", the UN Children's Fund (UNICEF) said.

"According to witnesses, armed soldiers surrounded the community and searched house by house. Boys older than 12 years of age were taken away by force," UNICEF said in a statement.

No group has claimed responsibility for the abductions and the gunmen's intentions were not clear, though in the past armed groups have forcibly recruited children before major offensives.

Conflict has been rife in South Sudan since December 2013, when fighting erupted in capital Juba between soldiers allied to president Salva Kiir and those loyal to his former deputy, Riek Machar.

At least 10,000 people have been killed and 1.5 million internally displaced.

UNICEF said about 12,000 children have been recruited into armed groups since the outbreak of war.

The latest incident took place near Malakal, the capital of Upper Nile State, in a small village that has seen its population swell to about 90,000 due to a flood of internally displaced people.

The community where the raid took place is mostly made up from members of the Shilluk tribe, South Sudan's third largest ethnic group after Kiir's Dinkas and Machar's Nuers.

While the war in South Sudan has often pitted Dinkas against Nuers, Shilluks have largely stayed neutral.

The use of child soldiers in South Sudan, which only became independent in 2011, has a long history.

Many armed groups have recruited children as South Sudan has been struggling to assert law and order across swathes of territory bristling with weapons after the 1983-2005 civil war with Khartoum.

The UN last month secured a pledge for the release of about 3,000 child soldiers in the country, in what it called "one of the largest ever demobilisations of children".

Reuters