US Secretary of State Anthony Blinken made a surprise visit to Baghdad on November 5, after visiting the occupied West Bank earlier in the day.
Iraqi Prime Minister Mohammed Shia al-Sudani met with Blinken, the prime minister's office said, and the two were expected to discuss the risks of an escalation in Israel's war with Hamas.
Blinken's visit - which came after a brief stop in Cyprus to discuss a possible sea route for aid to Gaza - was not announced in advance for security reasons.
Since the start of the war between Israel and Hamas, a series of rocket attacks and drone strikes have targeted military bases housing US forces in Iraq.
"I have made it very clear that attacks or threats coming from militias that are affiliated with Iran are completely unacceptable," Blinken said.
"We will take all necessary steps to protect our people," he added during a meeting with Iraqi Prime Minister.
Washington has accused Iran of having a hand in the attacks, which also targeted US troops in Syria.
According to Telegram channels linked to Iraqi factions close to Tehran, most of the attacks were claimed by a group known as the Islamic Resistance in Iraq.
Figures released by the Pentagon on Friday show that between October 17 and November 3, 17 attacks were carried out in Iraq and 12 in Syria.
About 2,500 US military personnel are stationed in Iraq, tasked with advising their Iraqi counterparts in the fight against the Islamic State group.
Iraqi Prime Minister Sudani condemned the attacks and said investigations were underway to identify the perpetrators.
He has repeatedly called for a ceasefire in the Gaza Strip and described Israel's military operation in the coastal territory as "genocide" against the Palestinian people.
During his meeting with Blinken, he reiterated calls for a ceasefire and stressed "the urgent need to contain the crisis and prevent its spread", his office said in a statement.
Iraq does not recognize Israel as a state and its government is close to Iran, which in turn supports Hamas.
On November 5, thousands of supporters of influential Shiite cleric Moqtada Sadr gathered in Baghdad's Tahrir Square, waving Iraqi and Palestinian flags, an AFP journalist reported.
Some of them burned Israeli and American flags during the demonstration, which followed a call by Sadr's movement on X, formerly Twitter, for a "peaceful protest" against Blinken's visit.
Blinken is on a sweeping tour of the Middle East, having visited Israel on Friday and Jordan on Saturday for talks with King Abdullah II, where he took part in ministerial meetings with five of his Arab counterparts.
Blinken traveled to the occupied West Bank yesterday to meet with Palestinian President Mahmoud Abbas before stopping in Cyprus, where he met with the country's president and foreign minister.
In Turkey, Blinken will "underline the importance of protecting civilian life in Israel and the Gaza Strip," the US State Department said in a statement on Saturday.
It will also discuss "our shared commitment to facilitate the enhanced, sustained delivery of life-saving humanitarian assistance to the civilian population of Gaza," as well as ensuring that Palestinians are not forcibly displaced outside of Gaza."
He will also discuss ways to "stop the violence, calm the rhetoric, reduce regional tensions" and work for "a lasting and sustainable peace in the Middle East that includes the creation of a Palestinian state." /BGNES