US Secretary of State Mike Pompeo arrived in Baghdad on Wednesday in an announced visit to meet Iraqi officials including the country's Prime Minister.
A trip to Iraq was rumoured and expected to be left off the official schedule due to security reasons.
The visit comes less than two weeks after President Donald Trump drew criticism for failing to meet a single Iraqi official during a surprise Christmas trip to US troops at an air base in western Iraq.
It also comes as Iraqi officials struggle to reach a consensus on key cabinet portfolios, including who should head the interior, defence and justice ministries.
In Baghdad, Mr Pompeo met with Prime Minister Adel Abdul Mahdi, President Barham Salih, the Foreign Minister Mohammed Al Hakim and Parliament Speaker Mohammed Al Halbousi. He also visited US soldiers stationed in the country.
He discussed with the prime minister the “lasting defeat throughout the region” of ISIS and American support for Iraq’s energy independence, Deputy State Department Spokesman Robert Palladino said.
The diplomat is in the Middle East to urge allies to continue to confront the "significant threats" posed by Iran despite Mr Trump's shock decision last month to pull all US troops from Syria.
Iraq's president told reporters after a meeting with Mr Pompeo that Baghdad wanted Washington to remain engaged.
"We will need the support of the US," Mr Salih said, expressing "gratitude to the US for support over the years".
"ISIS is defeated militarily, but (the) mission is not accomplished," Mr Salih added.
Mr Pompeo did not answer questions from reporters but took to Twitter to say that he looked forward to working with the new government in Baghdad in the future.
“Great to meet the new Iraqi government…and reinforce our bilateral ties.,” he said. “Look forward to working together on key regional issues and to supporting Iraq’s energy independence,” he said in an apparent reference to Iraq’s reliance on energy imports from Iran.
Iraq suffers from a chronic shortage of power that leads to routine outages lasting much of the day in many areas that have prompted angry protests.
It depends on imports from Iran of both electricity and gas to generate it, to maintain even existing supply.
Washington has granted Baghdad waivers from the crippling unilateral sanctions it reimposed on Tehran last year after Mr Trump pulled out of the landmark 2015 nuclear deal agreed by his predecessor Barack Obama.
But members of his administration have put increasing pressure on the Iraqi government to stop seeking waivers and call in US firms to provide an alternative.
Last month, US Energy Secretary Rick Perry visited Baghdad to urge Iraqi energy officials to reduce reliance on Iranian gas to run its power grid. The US Energy Secretary said Baghdad should partner with American companies to become energy independent.
Mr Pompeo on Wednesday also met with a number of Kurdish officials in Erbil, including President of the regional government of Iraqi Kurdistan Masoud Barzani, Kurdistan Region Security Council (KRSC) Chancellor Masrour Barzani and the prime minister of the Kurdistan region, Nechirvan Barzani.
Mr Pompeo was in Jordan on Tuesday. He is due to travel to Cairo today. He will also visit Bahrain, the UAE, Saudi Arabia, Kuwait, Oman and Qatar.
He is expected to deliver a lecture at the American University of Cairo on Thursday on US foreign policy in the Middle East.
Beyond the Headlines podcast: Pompeo's timely tour
Subscribe to Beyond the Headlines to receive new episodes every week: