Iceland mounted its very first armed police operation on Monday.
A man in his late 50s was shot dead by police after attempts to immobilise him had failed.
The incident was "without precedent" in Iceland's history, national police chief Haraldur Johannessen told a press conference in Reykjavik.
In the early hours of Monday morning, several shots rang out in an apartment in the capital. The police reacted by evacuating other residents in the building.
Efforts to contact the man were not successful, so they fired gas canisters through the windows in order to immobilise the shooter.
"That did not work and the man started shooting out of the windows of the apartment," said Reykjavik police chief Stefan Eiriksson.
The police resorted to sending a Swat team into the apartment where one officer was hit in the helmet and another on a shield. Neither men suffered injury.
But in a volley of returned fire, the armed man was injured and died soon after arriving at the hospital.
With a population of only 322,000, Iceland enjoys one of the lowest crime rates in the world. Shooting incidents are rare and police rarely use weapons.
An investigation has been opened to determine why the victim began shooting and whether he was under the influence of drugs or alcohol.