DUBAI, Dec 27 (Reuters) - Iranian President Hassan Rouhani said on Sunday that Muslims must improve the image of their religion, which has been tarnished by the violence of hardline groups such as Islamic State,

"It is our greatest duty today to correct the image of Islam in world public opinion," Rouhani told a conference on Islamic unity in Tehran in a speech broadcast by state television.

His remarks were rare for a leader of Iran, which considers itself an authority in the Islamic world and often blames the "enemies" of the religion for problems in the Middle East.

"Did we ever think that, instead of enemies, an albeit small group from within the Islamic world using the language of Islam, would present it as the religion of killing, violence, whips, extortion and injustice?" Rouhani said.

Rouhani, a relative moderate, said Islamic principles opposed violence and the extremism of groups such as Islamic State stemmed from "narrow-mindedness and a lack of moderation".

Rouhani criticised Muslim countries for "being silent in the face of all the killing and bloodshed" in Syria, Iraq and Yemen - conflicts in which Iran plays a role.

Iran supports the government of Syrian President Bashar al-Assad, has close ties with neighbouring Iraq, and condemns the Islamic State group which fights both governments.

The Islamic Republic is also an ally of the Houthi movement which seized control of most of Yemen last year and has fought a military coalition led by Saudi Arabia for nine months.

(Reporting by Dubai newsroom; Editing by Angus MacSwan)

Our Standards: The Thomson Reuters Trust Principles.