Kenya's government said a Sudanese man trained by al-Qaeda was among the leaders of a raid on a Nairobi shopping centre in which 67 people were killed.
Al-Qaeda-linked group al-Shabaab has claimed responsibility for the assault two weeks ago on the Westgate shopping centre.
It said it was an act of revenge for Kenya's military campaign in Somalia.
The identities of the gunmen have remained unclear.
A military spokesman said the four men included a Sudanese, a Kenyan Arab and a Somali
Closed-circuit television footage from the Westgate mall was broadcast on Kenyan television channels.
In the footage, apparently at least four alleged attackers with guns walking around the centre's supermarket and a storage room.
Major Emmanuel Chirchir said: "I confirm these were the terrorists, they all died in the raid."
He gave their names as Abu Baara al-Sudani, Omar Nabhan, Khattab al-Kene and Umayr. Kenya said previously that between ten and 15 militants were involved in the mall attack.
Al Sudani, from Sudan, was the leader of the group inside the mall and had been trained by al-Qaeda.
"He is an experienced fighter and sharpshooter," Maj Chirchir said.
Nabhan, a Kenyan of Arab origin, was born in Mombasa and travelled to Somalia with his uncle at the age of 16.
Al Kene is said to be Somali from the capital Mogadishu, and is linked to al-Shabaab Islamist militants, Maj Chirchir said.
Umayr's other names, nationality and biography were "not yet identified", he added.