BAGHDAD — U.S. Secretary of State Mike Pompeo made an unannounced trip to Iraq as Washington warns Iran against any action against American interests in the Middle East.

Pompeo was in Baghdad briefly Tuesday night before flying out. He said his visit was meant to show U.S. support for “a sovereign, independent” Iraq, free from the influence of neighboring Iran. He met with Iraq’s president and prime minister.

Pompeo’s visit comes amid increasing tensions between Washington and Tehran. The U.S. is rushing an aircraft carrier strike group to the Middle East to deter or respond to any Iranian attack. U.S. officials have said there are indications Iran is planning to retaliate for the Trump administration’s stepped-up sanctions on the country, although the threat information remains vague.

The decision to send an aircraft carrier and a group of Air Force bombers to the Middle East was based in part on intelligence indications that Iran had moved short-range ballistic missiles by boat in waters off its shores, an American official said Tuesday.

The movement, first reported by CNN, was among a range of recent indications that Iran might be considering or preparing to attack U.S. forces in the region, said the official, who spoke on condition of anonymity in order to discuss sensitive intelligence.

The official said it was not clear whether the boats with missiles represented a new military capability that could be used against U.S. forces or were only being moved to shore locations.

When the White House announced Sunday that the USS Abraham Lincoln carrier strike group and a bomber task force were being deployed to the Middle East, John Bolton, the national security adviser to President Donald Trump, cited “troubling and escalatory indications and warnings” but did not explain what they were.

Bolton said the movement of additional military firepower to the Middle East was meant to send a “clear and unmistakable message to the Iranian regime that any attack on the United States interests or on those of our allies will be met with unrelenting force.”

Patrick Shanahan, the acting secretary of defense, told reporters at the Pentagon on Tuesday that he had approved the expedited movement of the Lincoln strike group and the deployment of a bomber group based on “credible reporting” on Iran.

“What you see is us getting in the right posture for that dynamic environment” in Iraq and elsewhere in the region, Shanahan said. The U.S. has about 5,200 troops in Iraq.

Meanwhile, Iran is expected to announced Wednesday it is partially withdrawing from the nuclear deal it struck with world powers, its state-run news agency reported, a year to the day that President Donald Trump pulled America from the accord.

The terms of the withdrawal remain unclear, though the IRNA news agency said President Hassan Rouhani will explain Iran’s decision in letters to leaders of Britain, France and Germany that will be handed to ambassadors in Tehran. Iranian Foreign Minister Mohammed Javad Zarif separately will write to the European Union, the agency said.

The semi-official ISNA news agency reported late Tuesday that Zarif had left for Moscow to meet with Russian leader Vladimir Putin to discuss bilateral and international issues, without elaborating.

Details of the letters, all to signers of the 2015 accord, will not be publicly disclosed, it said.

The letters will come as officials in the Islamic Republic previously warned that Iran might increase its uranium enrichment, potentially pulling away from a deal it has sought to salvage for months.

The United Nations’ nuclear watchdog says Iran has continued to comply with the terms of the 2015 nuclear deal, which saw it limit its enrichment of uranium in exchange for the lifting of economic sanctions. But American sanctions have wreaked havoc on Iran’s already-anemic economy, while promised help from European partners in the deal haven’t alleviated the pain.

The U.S. last week stopped issuing waivers for countries importing Iranian crude oil, a crucial source of cash for Iran’s government. It also halted waivers allowing Iran to store excess heavy water in Oman and to swap enriched uranium for raw yellowcake with Russia.

Trump campaigned on a promise to tear up the deal struck by his predecessor, Barack Obama. While Trump has sought to dismantle much of Obama’s policies, he particularly criticized the Iran nuclear deal for failing to address Tehran’s ballistic missile program and what he described as its malign influence across the rest of the Mideast.