The Trump administration has accused Iran of supporting "imminent attacks" on USA personnel in the region and has used a burst of diplomacy and briefings to try to win support for an increasingly aggressive stance against Tehran.
The militants are most likely to attack innocent civilians or soft targets like the oil industry.
Separately, Iran's foreign minister said sanctions imposed by the Trump administration are "unacceptable" but added that his country is committed to an global nuclear deal that has steadily unraveled amid rising tensions.
And Spain recalled a frigate accompanying the USA carrier task force, explaining that the frigate's mission was not to take part in actual hostilities with Iran.
Iranian Foreign Minister Mohammad Javad Zarif on Thursday accused the United States of an "unacceptable" escalation of tensions.
In response to the U.S. sending a carrier and bombers to the region, the head of Iran's air force said the carrier "is a target".
The officials said intelligence about the behavior of Iraqi militias directly linked to Iran had been amassing over more than a week, suggesting that the militias had started making preparations for an attack on Americans.
Pompeo stressed during his visit that Iraq should not play a role in easing the sanctions on Iran.
Pompeo told Russian officials in the Black Sea resort of Sochi that the U.S. "fundamentally do not seek a war with Iran".
Trump blasted media reports about turmoil in the White House over a series of steps taken by the administration to up pressure on Iran, saying "there is no infighting whatsoever".
Under the deal, Tehran was allowed to produce low-enriched uranium within about a 660-pound limit, and produce heavy water with a stock capped at around 130 tons.
The European Union and the foreign ministers of Germany, France, and Britain said they were still committed to the deal but would not accept ultimatums from Tehran.
That is not enough to invade Iran but is enough for an attack from outside its borders. It has said it will keep strong ties with Iran, and also with both the United States and regional Arab neighbors, some of whom, like Saudi Arabia, consider Tehran an archrival.
Diplomatic security is a key priority for the United States.
The United States invaded Iraq in 2003 to topple dictator Saddam Hussein, occupying the country until 2011, and then sending troops back in 2014 to help fight ISIS, which was quickly spreading its self-proclaimed caliphate over large parts of Iraq and Syria. Iran has close ties to powerful Iraqi political parties and supports powerful Shi'ite militia groups.