Two people have died in Iran after testing positive on Wednesday for the new coronavirus, the health ministry said, in the Islamic republic's first cases of the disease.

They are also the first deaths from the COVID-19 virus in the Middle East and only the seventh and eighth outside China where the outbreak has killed more than 2,000 people.

State news agency IRNA quoted Kianoush Jahanpour, a ministry spokesman, as saying the virus was detected in two elderly people with immunity problems in the holy city of Qom, south of the Iranian capital.

"Following the recent cases of chronic respiratory diseases in Qom, two of the patients tested positive in preliminary tests," it quoted him as saying.

"Unfortunately both passed away in the intensive care unit due to old age and issues with their immune system."

The state news agency had earlier quoted Jahanpour as saying that the "new coronavirus" had been confirmed in two people and that other suspected cases were isolated.

IRNA also quoted a media adviser to Iran's health minister as saying two people had died after testing positive for the coronavirus.

"Both of the people who had tested positive for coronavirus were in Qom and were old. Both have passed away," said Alireza Vahabzadeh.