Police tracked the suspect down to the working class suburb of Intilaka where he detonated a suicide vest on Tuesday night, said a ministry spokesman.
"The terrorist Aymen Smiri was implicated in the twin suicide bombings on Thursday and investigations proved that he was the mastermind of the operation," the spokesman said, adding that Smiri was a "very active and very dangerous leader".
The investigation had led police to the 23-year-old who lived in Ibn Khaldoun, near Intilaka, the spokesman said.
"We tracked him down and followed him until he was cornered in Intilaka but happily he blew himself up away from other people."
Smiri was suspected of "planning a terrorist operation targeting security personnel," Zaag added.
Resident Ibrahim Mejri said: "I saw him running to try to get away from the police then suddenly he blew himself up."
Last Thursday's bombings in Tunis killed one police officer.