A Muslim cleric in Izbat Marco, a village in Beni Suef province, said he saw the boys, aged nine and 10, take pages of the Koran and urinate on them.
A Coptic priest said local Islamists attended demonstrations calling for revenge for the desecration of a Koran.
Human rights groups say allegations of contempt of religion are on the rise.
Seventeen cases have been filed since the 2011 uprising, many of them against Copts, who make up about 10% of Egypt’s 82 million people.
Tensions have also been heightened in the past month by the posting online of Innocence of Muslims – an amateur video made by a Coptic Christian in the US which mocks Islam and has sparked violent protests worldwide.
‘Feared for their lives’
A neighbour of the boys detained in Izbat Marco said he doubted the allegations were true because they were illiterate and could not have recognised the Koran.
“We brought one boy and asked him if he knew this is the Koran. He didn’t know it was the Koran. He can’t even read or write, like most kids in the village,” he told the Associated Press news agency.
The neighbour said a police office had detained the boys for their own safety because Islamists from outside the village had gathered at the mosque calling for revenge.
“We begged him to leave the kids. They can’t spend night outside their home. The officer said he feared for their lives and he wanted to keep them with him.”
On Thursday, a senior security official in Beni Suef, Gen Attiya Mazrou, said police had been ordered to release the boys, but that they would remain under investigation.