In a statement issued by the department, State Secretary Mike Pompeo accused Iran of engaging in "an escalating of threatening actions and statements in recent weeks".
Mr Pompeo's visit comes as Iran warned it will resume uranium enrichment unless the remaining signatories to the 2015 nuclear deal - France, Britain, Germany, China and Russian Federation - can show it is worth pursuing.
Pompeo reportedly asked Prime Minister Adel Abdul Mahdi and President Barham Salih to ensure the safety of Americans in Iraq and reaffirmed that the United States would cooperate to defend the country.
Pompeo said he would provide assurances of continued US support to train Iraqi security forces, and urge them to pursue energy deals with Jordan and Egypt so they could reduce their dependency on the Iranian electrical grid, the report mentioned. The deployment was in response to "recent and clear indications that Iranian and Iranian proxy forces were making preparations to possibly attack U.S. forces", the Pentagon said.
Journalists from The Associated Press and other organizations accompanying Pompeo were not told of his new destination until his plane left for Baghdad and were not allowed to report on his whereabouts until after his plane had taken off for London. "In each of those meetings, those two leaders promised that that was their objective, too, they were moving towards that goal", he said.
The "campaign to continue to prevent ISIS terror inside of Iraq itself is something that's very central ... to the Iraqi government", Pompeo said.
Mr Pompeo is the first member of President Donald Trump's administration to speak face-to-face with the PM and Foreign Secretary Jeremy Hunt since last month's National Security Council agreed to consider Huawai's involvement.
Iran, meanwhile, was expected to announced Wednesday that it would partially withdraw from the nuclear deal it struck with world powers in 2015. Iraq has a close relationship with the USA, which is leading the global coalition in the war against the Islamic State group in Iraq and Syria. "This is an obligation that Iraq would honour, (and) not accept any attack on anyone whether Iraqi, foreigner, whether it's an embassy or a company or a military mission", he said.
Germany has wide disagreements with the Trump administration and along with other European nations still supports the 2015 nuclear deal negotiated under former United States president Barack Obama.
He was due to meet both Chancellor Angela Merkel and Foreign Minister Heiko Maas later Tuesday in Germany.