"Upon information and belief, Iran or its proxies are planning a sneak attack on US troops and/or assets in Iraq," Trump tweeted on April 1.
"If this happens, Iran will pay a very heavy price, indeed!" he added.
It was not immediately clear if Trump meant the United States actually has intelligence of such a plan.
Over the past year, the United States has accused Iranian-backed militias of attacks on Iraqi military bases hosting coalition forces and on foreign embassies, particularly the US mission.
Hours before Trump's tweet, a top military aide to Iranian Supreme Leader Ayatollah Ali Khamenei cautioned the United States of consequences of "provocative actions" in Iraq.
"Any US action will mark an even larger strategic failure in the current president's record," General Yahya Rahim Safavi said, according to the semiofficial news agency Tasnim.
On March 11, a rocket attack on an Iraqi base killed two US troops and one British soldier, heightening tensions in the region.
No one claimed responsibility for the attack, which was followed by deadly US air strikes on the pro-Iranian Kataib Hezbollah militia group.
Based on RFE