Tehran summoned an official from the Swiss embassy, which represents US interests in Iran, to complain about American "warmongering" in neighbouring Iraq, the foreign ministry said on Wednesday.
"The Swiss charge d'affaires was summoned to the foreign ministry... over stances of American officials with regards to developments in Iraq," a ministry statement said.
"The Islamic Republic of Iran conveyed its strong protest... over warmongering remarks made by American officials which are in violation of the United Nations Charter," it added.
President Donald Trump and other US officials have blamed Iran for rocket fire that killed an American civilian contractor in northern Iraq on Friday.
They have also accused Iran of being behind the storming of the US embassy in Baghdad on Tuesday by protesters angry over retaliatory US air strikes in western Iraq that killed 25 militants.
In its statement, the Iranian foreign ministry said it had asked the Swiss charge d'affaires to inform the United States that "Iraq is an independent country".
"The American army has martyred at least 25 young Iraqis and has wounded countless more without presenting the slightest evidence of them being at fault," it said.
"Naturally the people of Iraq react to the country that has occupied their country and kills their young people."
Tehran and Washington have not had direct diplomatic relations since Iranian students stormed the US embassy in 1980 and held staff hostage for 444 days.