Iraqi Prime Minister Mustafa Al Kadhimi pledged to personally undertake a review of the intelligence services after a double suicide bombing claimed by ISIS killed dozens in the capital on Thursday.
At a meeting of his National Security Council on Friday, Mr Al Kadhimi called for incompetent security officials to resign.
"Security is not just a word we speak in the media, but a responsibility," Mr Al Kadhimi said. "Whoever does not rise to their responsibility to protect citizens and their security must step down from his position."
Several top security officials were sacked or transferred from their posts immediately after the bombings, including the deputy minister of interior for intelligence affairs, the interior ministry's director general of intelligence and combating terrorism, and the director of intelligence and security for Baghdad.
ISIS claimed the attack in a message posted on the Telegram channel of its Amaq news agency on Friday. It identified the first bomber as Abu Youssef Al Ansari and the second as Mohammed Arif Al Muhajir.
At least 32 people were killed in the blasts at an outdoor market in the Barb Al Sharji area, and more than 100 injured, many seriously, officials said.
ISIS seized control of large areas of northern and western Iraq in 2014 before being defeated by Iraqi and international forces in 2017. Remnants of the extremist group are active in other areas of Iraq, but Thursday's attack was the first in the capital since 2018.
Mr Al Kadhimi, Iraq's former national intelligence chief, said the bombings revealed failings that needed to be addressed.
"Our security services made a great effort during the past months, and there were major operations against ISIS terrorist gangs, and most of our operations succeeded. There are daily attempts by ISIS to reach Baghdad that are thwarted with pre-emptive operations, but unfortunately they managed it yesterday," the prime minister said.
"There are challenges in the intelligence services that must be addressed urgently, and I will personally supervise this issue," he said, promising to take "urgent measures".
"Iraq is one state, and all its security and military institutions must act in one spirit. We will impose unification of intelligence efforts in all seriousness.
"We have made a series of changes in the security and military structure, and are working on developing a comprehensive and effective security plan to meet the coming challenges."
The attacks came as Iraq prepares to hold early elections in response to mass protests calling for political reform and better governance. Mr Al Kadhimi took office in May after the protests forced his predecessor to step down.