The US military is flying armed drones over Baghdad to defend American troops and diplomats in the Iraqi capital if necessary, the Pentagon said on Friday.

The move comes after the United States deployed 180 troops as military advisers in recent days to help the Iraqi government army fend off the advance of Sunni extremist militants, who have captured territory north and west of the capital.

The military for more than a week has been flying manned and unmanned aircraft over Iraq, averaging a few dozen sorties daily for reconnaissance.

The flights involved "a few" drones and were ordered as a precaution to safeguard Americans in Baghdad, for what the military calls "force protection," a senior US official, who spoke on condition of anonymity, told AFP.

But officials said the armed drones would not be used to carry out offensive strikes on Sunni extremists, a move that would require a decision by President Barack Obama.

The Pentagon acknowledged that among the aircraft flying over Iraq to carry out surveillance, some were carrying bombs and missiles – without specifying if those planes were drones.

"The reason that some of those aircraft are armed is primarily for force protection reasons now that we have introduced into the country some military advisers whose objective will be to operate outside the confines of the embassy," spokesman Rear Admiral John Kirby told a press conference.

‘Ready’ for airstrikes

Using US air assets to target the leaders of the Sunni-led insurgency is one of the options being prepared for Obama as he considers what support to provide to Iraq, the chairman of the Joint Chiefs of Staff, General Martin Dempsey, said in a radio interview.

Protection of critical infrastructure is part of that option, he said.

“We’re flying a great deal [of] manned and unmanned ... intelligence and reconnaissance assets, and we’re building a picture so that if the decision were made to support the Iraqi security forces as they confront [militants from the Islamic State of Iraq and Greater Syria movement, or ISIS], we could do so,” Dempsey said.

Obama has so far not ruled out air strikes, but for the moment American forces are focused on gauging the state of the Iraqi military and its adversaries on the battlefield, he said.

"The president has made no decisions about the use of kinetic force, but it would be irresponsible for us not to be planning, preparing and thinking and to be ready in case he should make that decision," Admiral Kirby said.