The dismembered bodies were found on Monday, scattered across a forest clearing in Muidumbe district.
Radical militants operating in the area had attacked several nearby villages over the weekend, looting and burning down homes before retreating into surrounding thicket.
"Police learnt of the massacre committed by the insurgents through reports of people who found corpses in the woods," said an officer in the neighboring Mueda district who asked not to be named.
"It was possible to count 20 bodies spread over an area of about 500 meters," he added.
"These were young people who were at an initiation rite ceremony accompanied by their advisers."
An aid worker in Mueda, who also declined to be named, confirmed the massacre had taken place, saying some of the boys had come from that area.
She said body parts had been sent to their families for burial on Tuesday.
"Funerals were held in an environment of great pain," said the worker.
"The bodies were already decomposing and couldn't be shown to those present."
Extremists have caused havoc in Mozambique's northeastern Cabo Delgado province over the past three years, ravaging villages and towns as part of a campaign to establish a caliphate.