Iranian military forces have said they are prepared to use medium- to long-range missiles to attack US bases in the Middle East, in revenge for the assassination of the country’s most senior general, Qassem Suleimani.

According to a report by the semi-official Tasnim news agency, Iran has prepared 13 scenarios for retaliation, and the secretary of Iran’s national security council said that even the most limited of the options would be a “historic nightmare” for the US.

Ali Shamkhani told the news agency: “The 27 US bases that are closest to Iran’s border are already on high alert; they know that the response is likely to include medium-range & long-range missiles.”

Profile Who was Qassem Suleimani? Show Hide Qassem Suleimani, killed by a US drone strike in Baghdad, had become well known among Iranians and was sometimes discussed as a future president. Many considered Suleimani to have been the second most powerful person in Iran, behind supreme leader of Iran Ali Khamenei, but arguably ahead of President Hassan Rouhani. He was commander of the Quds Force, the elite, external wing of the Iran’s Islamic Revolutionary Guard Corps, which the Trump administration designated as a terror organisation in April last year. He was born in Rabor, a city in eastern Iran, and forced to travel to a neighbouring city at age 13 and work to pay his father’s debts to the government of the Shah. By the time the monarch fell in 1979, Suleimani was committed to the clerical rule of Ayatollah Ruhollah Khomeini, and joined the Revolutionary Guards, the paramilitary force established to prevent a coup against the newly declared Islamic Republic. Within two years, he was sent to the front to fight in the war against the invading Iraqi army. He quickly distinguished himself, especially for daring reconnaissance missions behind Iraqi lines, and the war also gave him his first contact with foreign militias of the kind he would wield to devastating effect in the decades to come. By the the time the Iraq government fell in 2003, Suleimani was the head of the Quds force and blamed for sponsoring the Shia militias who killed thousands of civilian Iraqis and coalition troops. As fighting raged on Iraq’s streets, Suleimani fought a shadow war with the US for leverage over the new Iraqi leadership. Once described by American commander David Petraeus as ‘a truly evil figure’, Suleimani was instrumental in crushing street protests in Iran in 2009. In recent months outbreaks of popular dissent in Lebanon, Iraq and Iran were again putting pressure on the crescent of influence he had spent the past two decades building. Violent crackdowns on the protests in Baghdad were blamed on militias under his influence.

Eighteen months before his death, Suleimani had issued Donald Trump a public warning, wagging his finger and dressed in olive fatigues. “You will start the war but we will end it.” Michael Safi Photograph: Mehdi Ghasemi/AFP

The US defence secretary, Mark Esper, confirmed that forces in the region were braced for Iranian reprisal strikes, but said the US would prefer a diplomatic solution.

“We’re prepared for the worst. We hope that cooler heads in Tehran will prevail and de-escalate the situation,” Esper told CNN. “We are not looking to start a war with Iran but we are prepared to finish one … What we would like to see is the situation de-escalated and for Tehran to sit down with us and begin a discussion about a better way ahead.”

US allies have already begun leaving Baghdad, which was buzzing as night fell with helicopters flying in and out of the city’s fortified diplomatic district, known as the Green Zone. Canada, which currently leads the Nato training mission, said it was pulling out some of its 500 troops. Most of the Nato troops withdrawing were reported to be heading for Kuwait.

“We have temporarily suspended our training on the ground, and we are taking all precautions necessary to protect our people,” a Nato spokesperson said. “This includes the temporary repositioning of some personnel to different locations both inside and outside of Iraq.”

The US-led coalition to counter Isis is also repositioning its forces to lessen their vulnerability to attack. Britain’s defence secretary, Ben Wallace, said that non-essential personnel were being moved from Baghdad to Taji, around 30km to the north.

Observers said that the escalating military rhetoric in Tehran may leave Iranian leaders with little option but to attempt a major counterattack, or else suffer an extraordinary loss of face. The warnings have led US bases in Kuwait, Iraq, Jordan and Saudi Arabia to be placed on maximum alert status.

Members of the so-called Resistance axis, including pro-Iranian militias from Iraq, will meet in Tehran in the next 48 hours to discuss tactics, it was reported.

Suleimanis’s replacement as leader of Iran’s Revolutionary Guards Corps, Maj Gen Hossein Salami, warned on Tuesday that Iran would “set ablaze the places Americans love”.

Speaking to a crowd of thousands of mourners in Suleimani’s home town, Kerman, Salami said: “We will take revenge – a revenge that will be tough, strong, decisive and finishing and will make them regret.”

Iran: dozens dead in crush at Suleimani burial procession Read more

Other military figures speaking at the funeral said any base of US naval assets within 2,000 miles of Iran was a possible target.

The Iranian foreign minister, Javad Zarif, insisted the Iranian response to US state terrorism would be proportionate, and not conducted by surrogate forces.

“This is an act of aggression against Iran, and it amounts to an armed attack against Iran, and we will respond. But we will respond proportionately – not disproportionately … We are not lawless like President Trump.”

He said the attack would occur at the time of Iran’s choosing. He added “Unlike the United States, we do not take cowardly terrorist acts ... when we do it, we will declare it.”

Such a move would mark a change of tactics for Iran which has traditionally depended on surrogate forces to carry out attacks on its behalf.

The US has denied Zarif a visa to travel to New York to address the UN security council on the crisis. The refusal of a visa marked a violation of the headquarters agreement the US signed at the UN’s founding.

Asked about the decision on Tuesday, the US secretary of state, Mike Pompeo, insisted the US “will always comply with our obligations under the UN requirements and the headquarters agreement, and we will do so in this particular instance and more broadly every day”. But he did not explain how refusing Zarif a visa could be reconciled with that claim.

Future of US military presence in Iraq in question amid confusion in Washington Read more

The Trump administration also did little to clarify the confusion that arose on Monday over its intentions in Iraq. Pentagon officials had said that a letter sent to the Iraqi government from the US taskforce commander in Iraq announcing a troop departure, had been a draft which had been released by mistake.

Iraq’s acting prime minister, Adel Abdul-Mahdi, however, insisted that the letter had been official and that it had initially been sent back to the US commander over a translation query, and then it had been redelivered with a corrected translation.

“They said it’s a draft. OK, it’s a draft. But we received it. As a state, how are we supposed to act? We should get a second letter to clarify so we can clarify to our people too,” Abdul-Mahdi, who resigned in November but has stayed on in a caretaker role, said, according to the Agence France-Presse. “If I don’t trust you and you don’t trust me, how are we supposed to proceed?”

In a prerecorded television address he insisted the US would have to leave.

“We have no exit but this, otherwise we are speeding toward confrontation,” Abdul-Mahdi said, adding that Iraq would have to take a “historic decision” to implement the expulsion. “Otherwise we will not be taken seriously,” he added.

Esper insisted “a draft unsigned letter acquired by an Iraqi official had no value”. The defence secretary added that the US intended to stay in the country, and that an Iraqi parliamentary vote on Sunday which called on its forces to leave was not the final word.

“Nearly all of the Kurds and all of the Sunni Council members either abstained” or did not vote, he said, adding that many of the Shia deputies who voted for it “did so because they were threatened”.

Asked about Trump’s threat to bomb Iranian cultural sites, a potential war crime, Esper said he was confident that the president “will only give us legal orders”.

“We do not violate the laws of armed conflict,” he said.

Esper said that, when he was killed, Suleimani was involved in planning attacks on US targets that would have been carried out in “only a matter days, certainly no more than weeks”.

US air force says fighter jet test is 'coincidence' after Trump's Iran threat Read more

The US has rejected Iranian and Iraqi claims that Suleimani, the head of Iran’s elite Quds Force, an external arm of the Revolutionary Guard, was in Baghdad on a diplomatic mission.

“Is there any history that would indicate that it was remotely possible that this kind gentleman, this diplomat of great order Qassem Suleimani had traveled to Baghdad for the idea of conducting a peace mission?” Pompeo asked reporters derisively.

“We not only know the history, we know in that moment that was not true. Zarif is a propagandist of the first order.”