Six civilians and a policeman died when a gunman tried to storm a church but was intercepted and arrested, it said.
It said the man had previously attacked a Coptic-owned shop in the same area, killing two brothers.
The interior ministry revised an earlier account given by the health ministry.
The initial report said 12 were dead, and suggested there were two attackers. It said one had been killed, and the other fled but was later captured.