The exchange of gunfire between police and rebels lasted for more than four hours, the official said.