The suspect took out a gun and started firing at officers during a random street check near the capital's busy central market, the source told AFP.
He then tried to flee but was soon discovered dead behind a building.
The officer shot in the exchange was taken to a hospital. His injury is not life-threatening and nobody else was hurt.
The authorities were not treating the incident as terror-related at this stage, the source added.