The 25-year-old unemployed man was arrested on Sunday as he entered a church in the Egyptian capital during a Coptic Christian service.
Days earlier, a knife-wielding man, said to be mentally ill, had killed a Christian in a church in Alexandria and stabbed six others.
On Monday, prosecutors ordered the man involved in Sunday's incident to be detained for four days. His name has not been released.
He will be held for questioning on suspicion of intending to commit a crime.
Friday's knife attack provoked two days of clashes between Christians and Muslims.
During the fighting a Muslim was killed after being clubbed over the head, and 55 people were arrested.
The Alexandria church attacker has been described as mentally ill by the Egyptian government, but Copts say the authorities are trying to make excuses for what some see as increasing attacks on Christians.
An interior ministry official has said the man arrested in Alexandria told police he was taking revenge for insults to the Prophet Muhammad, apparently a reference to cartoons of the prophet first published in a Danish newspaper last year.
Copts make up 5% to 10% of Egypt's 73 million people, most of whom are Sunni Muslim.