Washington deployed some 275 military personnel to protect its embassy in Baghdad, the first time it has publicly bolstered the mission's security.
And it was also mulling air strikes against the militants, who are led by the jihadist Islamic State of Iraq and the Levant (ISIL) but include loyalists of now-executed Sunni Arab dictator Saddam Hussein.
A relative calm in Baghdad was shattered by a string of bombings that left 17 people dead, while the bodies of 18 soldiers and police were found near the city of Samarra, shot in the head and chest.
Maliki also ordered that one of them face court-martial for desertion.
Also Read
The dismissals came after soldiers and police fled en masse as insurgents swept into Nineveh's capital Mosul, a city of two million, abandoning their vehicles and uniforms.
As officials trumpet a counter-offensive, doubts are growing that Iraq's security forces can hold back the tide.
However Pentagon spokesman Rear Admiral John Kirby said Iraqi troops, with help from Shiite volunteers, were "stiffening their resistance" around Baghdad.
After taking Mosul, militants captured a major chunk of mainly Sunni Arab territory stretching towards the capital.
The offensive has displaced hundreds of thousands of people and sent jitters through world oil markets as the militants have advanced ever nearer to Baghdad, leaving the Shiite-led government in disarray.
Officials said yesterday that militants briefly held parts of the city of Baquba, just 60 kilometres from the capital.
They also took control of most of Tal Afar, a strategic Shiite-majority town between Mosul and the border with Syria, where ISIL fighters are engaged in that country's three-year-old civil war.