Iam pretty sure it is part of Sharia(Islamic) law -but only practiced by fundamentalist.
Iran has recently amended it's law:
http://english.alarabiya.net/en/New...Iran-amends-law-on-stoning-for-adultery-.html
The controversial practice, in which stones are thrown at the partially buried offender, has provoked outcries from human rights organizations, international bodies and Western countries urging Iran to abandon it.
An article of Iran's Islamic new penal code, published earlier this week, states that, “if the possibility of carrying out the (stoning) verdict does not exist,” the sentencing judge may order another form of execution pending final approval by the judiciary chief.
The article does not explain what is meant by the possibility of stoning not existing.
In Iran, executions are normally carried out by hanging.
Under Iran's interpretation of Islamic Sharia law in force since its 1979 revolution, adultery is punished by the stoning of convicted adulterers.
Women are buried up to the their shoulders, but men only up to their waists. They are spared if they manage to free themselves before dying.
Murder, rape, armed robbery, drug trafficking are also punishable by death in
Iran, which has one of the
highest annual execution counts in the world, alongside China, Saudi Arabia and the United States.