Mr Pompeo cancelled a trip to Berlin to meet Iraqi leaders during a four-hour stop in the capital Baghdad.
He told the leaders that the US did not “want anybody interfering in their country”, and asked them to protect US troops in Iraq.
The visit came days after the US deployed an aircraft carrier, USS Abraham Lincoln, to the region.
Officials said the deployment was in response to threats to US forces and its allies from Iran. On Tuesday it was revealed the US was sending B-52 bombers.
The US has given little information about the exact nature of the reported threat, which Iran has dismissed as nonsense.
John Bolton, the US national security adviser, said only that the US was acting “in response to a number of troubling and escalatory indications and warnings” on announcing the deployment of the USS Abraham Lincoln on Sunday.
Mr Pompeo is also due to visit London on Wednesday, where he is scheduled to meet Prime Minister Theresa May and British Foreign Secretary Jeremy Hunt.
Why was Mike Pompeo in Iraq?
While in Baghdad, the US secretary of state met the Iraqi Prime Minister Adil Abdul-Mahdi and President Barham Salih, and explained the US’s security concerns to them.
He also asked them to protect US troops and citizens in the country.
Mr Pompeo later said that the leaders “provided assurances that they understood that was their responsibility”.
“We wanted them to know about the increased threat stream that we had seen, to give them a little bit more background so that they would have enough information that they could ensure that they were doing all that they could to provide protection for our team,” he said.
“They understood, too, it’s important for their country. We don’t want anybody interfering in their country, certainly not by attacking another nation inside of Iraq, and there was complete agreement.”
Speaking to reporters after the meeting, he also directly linked the visit to the recent escalation with Iran, which neighbours Iraq.
Mr Pompeo said that he wanted to “speak with the leadership there [in Iraq], to assure them that we stood ready to continue to ensure that Iraq is a sovereign, independent nation”.
He also said that he wanted to help them become less dependent on energy deals with Iran.
Why is the US sending bombers to the region?
Acting Pentagon spokesman Charles Summers said in a statement that the US did “not seek war with the Iranian regime, but we will defend US personnel, our allies and our interests in the region”.
“The deployment of the USS Abraham Lincoln Carrier Strike Group and a bomber task force are considered a prudent step in response to indications of heightened Iranian readiness to conduct offensive operations against US forces and our interests,” he added.
Officials first announced that the aircraft carrier was being sent to the Gulf on Sunday.
Mr Bolton said at the time that it was to send “a clear and unmistakable message to the Iranian regime that any attack on United States interest or on those of our allies will be met with unrelenting force”.
What has Iran said?
In response, Iran’s Foreign Minister Javad Zarif tweeted that “the #B_Team is at it again”.
“From announcements of naval movements (that actually occurred last month) to dire warnings about so-called ‘Iranian threats’,” he added. “If US and clients don’t feel safe, it’s because they’re despised by the people of the region – blaming Iran won’t reverse that.”
Iran’s state-run broadcaster Press TV also dismissed the deployment as “a ‘regularly scheduled’ one by the US Navy, and Bolton has just tried to talk it up”.
Why is there so much hostility between Iran and the US?
Tensions between the US and Iran can be traced back to Iran’s Islamic Revolution in 1979, which overthrew the pro-Western Shah and established a radical anti-US regime in its place.
But relations have been particularly fraught between the two nations since President Trump took office in 2017.
This most recent escalation comes on the eve of the anniversary of Mr Trump unilaterally withdrawing from a landmark nuclear deal the US and other nations had agreed with Iran in 2015.
Under the accord, Iran had agreed to limit its sensitive nuclear activities and allow in international inspectors in return for relief from sanctions – sanctions that have since been reinstated.
And last month, the White House said it would end exemptions from sanctions for five countries – China, India, Japan, South Korea and Turkey – that were still buying Iranian oil.
At the same time the US also blacklisted Iran’s elite Revolutionary Guard Corps, designating it as a foreign terrorist group.
The Trump administration hopes to compel Iran to negotiate a “new deal” that would cover not only its nuclear activities, but also its ballistic missile programme and what officials call its “malign behaviour” across the Middle East.
The sanctions have led to a sharp downturn in Iran’s economy, pushing the value of its currency to record lows, driving away foreign investors, and triggering protests.
Iran has repeatedly threatened to retaliate to the US measures by blocking the Strait of Hormuz – though which about a fifth of all oil consumed globally pass.