The figure does not include children forced from school by the conflicts in Syria and Iraq, who would bring the total not receiving an education to 15 million, the agency said in a new report.
The joint report by UNICEF and UN cultural agency UNESCO's Institute for Statistics praises the "considerable resources and political capital" devoted to expanding education in the Middle East over the last decade.
It notes that "out-of-school rates for primary school children have plummeted, often by as much as half."
"But in recent years, progress has stalled," it says, with 4.3 million primary-aged children and 2.9 million lower secondary-aged children out of school.
An additional 5.1 million children are not getting a year of pre-primary school education, bringing the total number of the region's children out of school to 12.3 million, the report says.
That figure represents around 15 percent of the children in the Middle East who should be receiving pre-primary, primary or secondary education.
The report says a study of nine countries in the region revealed a range of reasons that kept children out of school, including poverty.
In many cases, families could not afford costs associated with schooling, including books and uniforms, or the loss of income from a child who could be put to work.
- 'Girls are undervalued' -
"In countries where a substantial group of children remain out of school, they are predominantly from the poorest households in rural areas," the report says.
Gender discrimination also remains a factor.
"Girls are undervalued, and since they are not expected to work, their families see no need for them to learn," the report says, adding that early marriage is also an issue in most countries in the region.
Elsewhere, violence is a problem -- either inside schools, or in conflict zones like Syria and Iraq, where millions of children no longer have access to education and schools have been caught up in violence.
The report says keeping children in school once they enrolled was a key problem, with high drop-out rates at most levels in many countries in the region.
It proposes three main recommendations, including a focus on early childhood development (ECD), noting that pre-primary education is an area where the disparity between wealthy and poor children is most stark in the region.
"Levelling the playing field in terms of equal access to ECD is a matter of urgency," it said.
It also urges a cross-sector approach to helping children enter school, pointing out that factors from transportation to health can affect whether a child is enrolled or not.
Finally, it suggests a focus on "retention," ensuring that children are not pushed out of education once they enrol because of factors like corporal punishment or falling behind peers.
It also notes that special attention must be paid to the situation of children caught up in war, "given the recurring character of conflicts" in the region.
"The international community should ensure sufficient funding for education in emergencies and national governments in the region should adopt flexible approaches for accommodating the education needs of conflict-affected children."