Iran has confirmed three new coronavirus cases following the deaths of two elderly men, the health ministry told AFP on Thursday, as Iraq banned travel to and from its neighbour.

The pair who died were elderly Iranian citizens and residents of the city of Qom. They were the first confirmed deaths from the COVID-19 virus in the Middle East.

Health ministry spokesman Kianush Jahanpour said two of the new cases were also in Qom and the other was in Arak, south of the holy city.

"In total there were five cases... of which two have been fatal," he said.

Qom is a centre for Islamic studies and tourists, attracting scholars from Iran and beyond. However, a government official said the deceased men had not left Iran.

Following the announcement of the deaths, Iraq on Thursday clamped down on travel to and from the Islamic republic, with Iraq's health ministry announcing people in Iran were barred from entering the country "until further notice".

"Iranians are prohibited from entering (Iraq)," a senior official told AFP, adding that border crossings with Iran had been closed, with only returning Iraqis allowed to pass through.

Those Iraqis would be examined and, if necessary, placed in quarantine for 14 days, the health ministry said.

Iraqi nationals are also not allowed to travel to Iran, according to the ministry.

The border closure followed a backlash against a Wednesday announcement of visa waivers for Iranian nationals wishing to travel to Iraq.

Iraqis took to social media using the hashtag "close the border" and local officials called for a ban on the entry of goods and people through various border crossings with the Islamic republic.

Iraqi airports are already screening travellers for the virus and national carrier Iraqi Airways has suspended flights to Iran.

Each year, millions of Iranian pilgrims visit holy Shiite sites in Iraq, providing the Iraqi state with significant revenue.

Earlier Thursday, Iran's government spokesman Ali Rabiei said Tehran would set up a top-level body of government and defence officials to fight the virus' spread, according to state news agency IRNA.

An Iranian street vendor sells protective masks in the capital Tehran
An Iranian street vendor sells protective masks in the capital Tehran AFP / ATTA KENARE

"We, however, need global action (by authorities) and the cooperation of all citizens," Rabiei said on Twitter.

In Kuwait, national carrier Kuwait Airways announced Thursday it would suspend all flights to Iran, while its ports will also be closed to passengers travelling to and from the country.

Kuwaitis were advised not to travel to Qom, and were warned anyone arriving from the city they would be quarantined.

The deaths in Iran were reported by local media on Wednesday, just hours after Tehran said there were two cases in the country.

On social media, several people accused the government of keeping silent to prevent panic ahead of Friday's parliamentary elections.

"Just four hours separated the announcement that two compatriots were infected... and their deaths," journalist Javad Heydarian tweeted.

"This signifies that the virus had been around for some days but they hid the truth."

Public confidence in government pronouncements has plummeted since the downing of a Ukrainian passenger plane on January 8 that killed 176 people.

The government initially denied responsibility, but later admitted the plane had been fired on due to "human error" and blamed a jittery missile operator.

The culture ministry has asked local media to only publish official information from government officials and denounced what it claimed was a proliferation of fake news on social media regarding the virus.

Since December, the novel coronavirus has killed more than 2,200 people in China, the epicentre of the epidemic.

Elsewhere in the world, the virus has killed 11 people and spread across some 25 countries.