Nigerian police are searching for six children abducted from their school on the outskirts of the main city, Lagos.
The abductors freed four other children after "profiling" their parents, police said, apparently referring to the fact that they were not regarded as wealthy.
The men came through a swampy forest bordering the state-run Model College school, and cut a hole in the fence to enter, police said.
Schools in Lagos have been hit by several kidnappings for ransom.
Four children were abducted from the same school in October 2016, and three from another school in Lagos in March this year. They were later freed.
Lagos police spokesman Olarinde Famous-Cole condemned the abductions as "dastardly" and said an operation was under way to rescue the girls and apprehend the kidnappers.