For the past three days, armed terrorists have fought with troops in several parts of the city, declaring their operation, entitled Damascus Volcano, a final battle for the capital.
The rebel Free Syrian Army (FSA) and a jihadist group calling itself Lord of the Martyrs Brigade both said they were behind the security headquarters bombing.
Security sources say the suspected bomber worked as a bodyguard for members of President Bashar al-Assad's inner circle.
As events in Damascus unfolded, a UN Security Council vote on a Western-sponsored resolution threatening Syria with tougher sanctions was postponed until Thursday following a request by UN and Arab League envoy Kofi Annan.
"The terrorist explosion which targeted the national security building in Damascus occurred during a meeting of ministers and a number of heads of security agencies," state TV said.
Gen Daoud Rajiha had been defence minister for less than a year, serving previously as chief of staff, and was on a US blacklist for his role in the suppression of dissent.
Gen Assef Shawkat was married to Mr Assad's sister Bushra and considered a top security chief and a member of the inner circle of the regime.
Gen Hassan Turkomani was a former defence minister and assistant to the vice president as well as being in charge of President Assad's crisis management office.
The Syrian government's information minister Omran Zoab, said the attack was cowardly
A long-standing senior member of the ruling Baath party and a Sunni Muslim, he was put in charge of the security forces' crisis team when the uprising began in 2011, opposition activists said.
Hisham Ikhtiar, director of the National Security Bureau, and Interior Minister Mohammad Ibrahim al-Shaar, were among those hurt in the attack, state TV said.
The defence minister has been replaced by Gen Fahd Jassim al-Furayj, chief of staff of the armed forces, state TV reports.
An armed forces' statement read out on TV said Syria was more determined than ever to fight terrorism and wipe out criminal gangs.
Whoever thinks that killing top commanders "can twist Syria's arm... is delusional", it said.
The UN Security Council had been due to vote on a new round of sanctions against Syria and Russia's Deputy Foreign Minister Gennady Gatilov tweeted that there was a dangerous pattern of militant attacks coinciding with Security Council meetings on Syria.
UN chiefs, who have until Friday to renew the mandate for observers in Syria, have been trying to persuade China and Russia to agree tougher measures on Damascus.
President Barack Obama and Russian President Vladimir Putin discussed the crisis by telephone on Wednesday. But, according to Interfax news agency, although they agreed on a final goal they disagreed on how to reach it.