Washington (AFP) - President Donald Trump on Monday repeated his insistence that Iran will not be allowed to obtain a nuclear weapon, amid mounting tension over the US killing of a top Iranian commander.

Writing in all-caps, the US leader tweeted: "IRAN WILL NEVER HAVE A NUCLEAR WEAPON!"

The tweet came a day after Tehran announced it was further winding down observance of parts of an international deal struck to ensure that the country does not secretly develop a nuclear weapon under cover of its civilian nuclear industry.

Trump withdrew the United States from the 2015 deal negotiated under his predecessor Barack Obama. Last year, Iran resumed uranium enrichment, reporting a tenfold increase in production.

Tensions between the two countries spiked last week when a US drone strike in Baghdad killed Qasem Soleimani, the head of the Iranian Revolutionary Guards' Quds Force.

While Iran has threatened retaliation for the killing, Trump has warned that the US will strike "very hard and very fast" at as many as 52 Iranian targets if the Islamic republic does attack US personnel or assets.

Huge crowds turned out Monday in Iran for the 62-year-old commander's funeral, while in neighboring Iraq, parliament has voted to expel some 5,200 US troops stationed in the country.

Trump's tweet did not add any details about steps he was considering to prevent Iran from reviving its nuclear program. Iran has always denied any military dimension to its nuclear project.