"Armed men aboard a minibus opened fire on them and then made off," the official told AFP.
Scores of policemen and soldiers have been killed in bombings and shootings since the Egyptian military deposed Islamist president Mohamed Morsi in July last year.
Most of the attacks have been in the Sinai Peninsula, the deadliest of them claimed by Ansar Beit al-Maqdis, a militant group that has pledged allegiance to the Islamic State organisation.
But there have also been repeated attacks elsewhere in Egypt, including in the capital.