Baghdad: Iraq's prime minister said he would sue the president Monday in a desperate bid to cling to his job, deploying security forces across Baghdad even as violence raged in the north.

A defiant Nuri al-Maliki made his shock announcement after three days of US strikes against jihadist militants in the north of Iraq and in spite of mounting calls for him to step aside.

"Today I will file a formal complaint to the federal court against the president," Maliki said in an address broadcast on the stroke of midnight on state television.

He alleged that Iraq's, Kurdish veteran Fuad Masum, had violated the constitution twice, essentially by failing to designate him as the prime minister.

Masum theoretically had 15 days after his July 24 election to pick a prime minister.

Maliki's coalition won April polls comfortably but his standing has been undermined by a devastating jihadist offensive launched on June 9 that overran large swathes of Iraq.

The political process has also been complicated by a constitutional tussle on how to define the largest parliamentary bloc entitled to nominate a prime minister.

The 64-year-old premier had pledged in a 2011 AFP interview he would not seek a third term but he has since changed his mind despite flagging support from nearly all his erstwhile allies: the United States, Iran, Shiite clerics and even his Dawa party.

"The United States fully supports President Fuad Masum in his role as guarantor of the Iraqi Constitution," State Department spokeswoman Marie Harf said.

Security everywhere Security sources told AFP of a massive security deployment, akin to measures taken in a state of emergency, across the capital Baghdad.

"There is a huge security presence, police and army, especially around the Green Zone," the highly-protected district that houses Iraq's key institutions, a high-ranking police officer said.

He said the deployment started at around 10:30 pm (1930 GMT), just 90 minutes before Maliki gave his speech.

While it remains unclear whether Maliki has a valid constitutional argument, the mass deployment of counter-terrorism SWAT teams across Baghdad was an obvious show of force.

"Several streets have been closed... as well as some key bridges," said an official at the interior ministry. "It's all linked to the political situation."

In his brief address, Maliki said Iraq was facing a "dangerous" situation and urged "the sons of Iraq" to be on alert.

Masum is a Kurd and relations between Baghdad and the autonomous Kurdish region in northern Iraq have been strained of late.

The Kurds have long complained that the federal government was not sending them their 17 percent share of federal oil resources.

Kurdish peshmerga fighters then seized long-coveted areas over which they were in dispute with Baghdad, including the oil-rich Kirkuk region, when routed federal forces retreated in the face of the jihadist onslaught two months ago.

That prompted Maliki to accuse the Kurdistan Regional Government of siding with the Islamic State (IS) group and the "caliphate" it declared in late June over parts of Iraq and Syria.

Cash-strapped Kurdistan's troops initially fared better than Baghdad's but over the past week jihadists made spectacular gains, seizing the country's largest dam and advancing within striking distance of the Kurdish capital.

Peshmerga fightback That was one of the reasons that prompted US President Barack Obama to announce on Thursday he was sending warplanes back over the skies of Iraq for the first time since the last US troops withdrew in 2011.

His other justification was the risk of an impending genocide against the Yazidi minority, many of whose people had been stranded on a mountain following an Islamic State attack.

Three days of strikes by US jets and drones appeared to make an impact on both fronts, raising hopes that US intervention could turn the tide on two months of jihadist expansion.

Meanwhile, officials said 20,000 mostly Yazidi civilians who had been trapped on Mount Sinjar since jihadists overran their hub of Sinjar a week ago had managed to escape.

They were escorted through Syria and back into Iraqi Kurdistan by Kurdish forces and added to the more than 200,000 displaced persons who have already entered the autonomous region since August 3, according to figures provided by several aid groups.

Only hours before Maliki spoke on television, French Foreign Minister Laurent Fabius was in Iraq to supervise the delivery of French aid.

Britain has also joined a humanitarian effort, which Obama said was aimed at averting an impending genocide by sending in transport planes to drop emergency supplies to Sinjaris.

At pains to assure war-weary Americans he was not being dragged into a new Iraqi quagmire, Obama on Saturday put the onus on Iraqi politicians to form an inclusive government.