Interior Minister Ihor Klymenko said special tactical police units stormed the store after attempts to contact the gunman with a negotiator failed.
The attacker was killed while resisting arrest, he said.
"The shooter in Kyiv was liquidated during the arrest," Klymenko said on the Telegram.
Speaking to reporters at the scene, Klymenko provided no speculation as to the assailant's motives but said that police negotiators spoke with the attacker for about 40 minutes.
"We tried to persuade him, knowing that there was likely a wounded person inside. We even offered to bring in tourniquets to stop the bleeding but he did not respond," Klymenko said.
"Consequently, the order was given to neutralise him."
Klymenko, who wore body armour, said the man was carrying a carbine, which was legally registered.
"Furthermore, in December of last year, 2025, he approached the licensing authorities to have the weapon test-fired as the permit was expiring. He provided a medical certificate. He had also submitted an application to renew his permit for the weapon. That is all we can say for now," Klymenko said.
He added that the investigation will determine which medical institution issued the certificate.
Ukraine's Security Service said the shooting was being investigated as a terrorist act, but offered no motive.
President Volodymyr Zelenskiy, speaking in his nightly video address, said the shooting happened in the leafy Holosiivskyi district, injuring 14 people.
"He took hostages and unfortunately, one of them was killed," Zelenskiy said.
"Four people died simply on the street. One woman died in hospital after being seriously wounded."
One of the wounded was a 12-year-old boy whose parents were also killed, Prosecutor General Ruslan Kravchenko said.
A woman who identified herself as Hanna said the suspect was a neighbour who steered clear of other residents.
"He didn't want to communicate with anyone," she said.
"When I sat outside on the street - he knew me by my face - he would greet me briefly and hurry off to run his errands. He wasn't close with his neighbours or anyone else."
Kravchenko said the shooter had been identified as a native of Moscow, born in 1958, and was brandishing an automatic weapon.
He posted a photo showing a blurred prone figure covered in blood inside a store, with a weapon lying nearby.
Zelenskiy said the suspect had a criminal record and had set fire to the apartment where he was registered before going into the street with the gun.
The president said he had lived for some time in the eastern Donetsk region, one of the focal points of the four-year war with Russia.
"Everything that can be known about him and why he did this is being clarified. Every detail needs to be checked," Zelenskiy said.
"The investigators have several versions. All his electronic devices, phone, all contacts will be checked."
with AP