A third of children in Somalia's drought-affected areas are at risk of dropping out of school, the UN says, as a shortage of food and water has left more than 6.2 million people needing urgent help.

The drought is threatening the lives of millions and almost three million are going hungry. Three million children in the country are missing school and more than 100,000 could join them, according to the UN.

On Tuesday, Somalia's newly elected President Mohamed Abdullahi Mohamed declared a "national disaster" due to the drought.

The Horn of Africa nation is one of three countries - along with Yemen and Nigeria - that the aid agencies say are on the verge of famine.

The desperate search for water and food proving particularly difficult for children.

"I'd love to go back to school, but I've been forced to leave because I'm the eldest child in my family and I need to work at home," Sadia Omar, a former student, told Al Jazeera.

"I fetch water and grass for the animals, but now because of the drought there is more work."

Al Jazeera's Fahmida Miller, reporting from Dollow in southern Somalia, said severe drought was forcing families to migrate in search of help.

"The number of children at this school [in the Dhuma Dhuma area] has halved in just three months," she said.

"Families here live off their livestock and they're doing all they can to keep their animals alive. If that means keeping their children out of school to look after them, many families are prepared to make the sacrifice."

READ MORE: 40 percent of Somalis don't have enough food to eat, says UN

On Monday, the World Health Organization (WHO) warned that Somalia was at risk of its third famine in 25 years. The last one, in 2011, killed almost 260,000 people.

The drought has led to a spread of acute watery diarrhoea, cholera and measles and nearly 5.5 million people are at risk of contracting waterborne diseases.

According to the WHO, more than 363,000 acutely malnourished children and 70,000 severely malnourished children need urgent, life-saving support.

"If the drought continues, these children will continue missing school and it will also impact their future learning and they won't come back," Abdihakim Ahmed, the headteacher at the school in Dhuma Dhuma, said.