Iranian President Mahmoud Ahmadinejad has been criticised by Iranian clerics for his 'inappropriate' behavior at the funeral of Venezuelan President Hugo Chavez.

A picture from the funeral that took place in Caracas last week, in which Ahmadinejad is seen consoling late Venezuelan President Hugo Chavez's mother with a hug, has been widely published in the Iranian press.

The act of physical contact between a man and woman who are neither married nor related is considered a sin under Iran's strict Islamic codes.

Iran's President Mahmoud Ahmadinejad
Iran's President Mahmoud Ahmadinejad (R) offers his condolences to Elena Frias, mother of Venezuela's late President Hugo Chavez, during the funeral service at the Military Academy in Caracas March 8, 2013, in this picture provided by the Miraflores Palace. Chavez will be embalmed and put on display "for eternity" at a military museum after a state funeral and an extended period of lying in state, acting President Nicolas Maduro said on Thursday. REUTERS/Miraflores

The behavior is considered taboo-breaking in Iran where the Islamic codes are strictly enforced, according to Oregon Live.

According to the Iranian newspapers, the religious center of Qom described the hug as "forbidden," and "clowning around."

"Touching a non-mahram (a woman who is not a close relative) is forbidden under any circumstances, whether shaking hands or touching by the cheek," said one of the clerics, Mohammad Taqi Rahbar.

He added that such contact, even with an older women, is prohibited and a disgrace to the dignity of the president of the Islamic Republic of Iran.

According to Ayatollah Mohammad Yazdi, a former chief of the Iranian judiciary and a religious leader in Qom, Ahmadinejad's behavior seemed like "clowning around."

Yazdi further said that Ahmadinejad failed to "protect the dignity of his nation and his position," by hugging the late Venezuelan President's mother.

The Islamic clerics were also upset by a condolence letter written by Ahmadinejad to the Venezuelan people. In the letter, Ahmadinejad had described Chavez as a "martyr" and has compared Chavez with Jesus Christ and Imam Mahdi, a saint revered by Shiite Muslims.

"Your knowledge of religious issues is limited and no intervention could be made in this matter," said Yazdi, addressing Ahmadinejad directly.

Initially, Iranian Vice President Mohammad Reza Mirtajeddini, a cleric who accompanied Ahmadinejad to Venezuela and stood while he hugged Chavez's mother at the funeral, had tried to deny the story by calling the photo 'fake'.

"You are a cleric and you wear the clerical robe ... you should not deny what happened," Yazdi told of Mirtajeddini.

A letter has been issued by 18 lawmakers urging Ahmadinejad to observe national and international norms in his foreign meetings.

Iran's presidential elections are just three months away.