Two Iranians have been sentenced to death for persistent consumption of alcohol under the country's Islamic Sharia law, which forbids the use, manufacturing and trading of all types of alcoholic drinks.

The two, who have not been named by the authorities, have each previously been lashed 160 times after twice being arrested for consuming alcohol. Being convicted for the third time makes them liable for the death penalty.

The head of the judiciary Seyed Hasan Shariati, based in Iran's north-eastern province of Khorasan Razavi, told the semi-official Isna news agency that the supreme court had upheld their death sentences and that officials were preparing for their execution.

"Two people who committed the offence of consuming alcohol for the third time have been sentenced to be executed. The verdict has been confirmed by the supreme court and we are preparing to administer it," he said.

Under Iranian Sharia law, certain crimes such as sodomy, rape, theft, fornication, apostasy and consumption of alcohol for the third time are considered to be "claims of God" and therefore have mandatory death sentences.

Sentences for such crimes, which are called Hodud in the Islamic terminology, are not at the discretion of the judge but are defined by Sharia law.

For some of these crimes, including theft and lesbianism, the death penalty is only handed down if the convict is a re-offender who has already been punished three times for the same crime in the past. In the case of alcohol, the death penalty comes on the third offence.

According to Shadi Sadr, an Iranian lawyer based in London, a decision on whether such a punishment can be issued depends on the judge's knowledge – a loophole which allows for subjective judicial rulings where no conclusive evidence is presented.

"Prostitutes are often victims of such punishment and can be given a death sentence," Sadr said. "Because having illicit sexual relationships is their job and they often get caught by the police it's very likely that they will have committed the crime three times in the past."

In crimes related to alcohol consumption, Shariati warned: "We will show no mercy in finding, trying and punishing those breaking the law and we will punish them to the highest extent."

Despite the ban, many people in Iran drink alcohol, usually a homemade liquor called araq, which contains 45% pure ethanol. It is usually mixed before consumption and can be dangerous because of the ethanol used in its distillation.

Hosts who throw parties call an alcohol vendor who delivers it to the door. Western alcohol is smuggled to Iran and can be found in underground markets but can be costly. People who belong to non-Muslim minorities such as Christians and Armenians, which are recognised by the authorities, are allowed to produce and consume alcohol in the country.

In a rare acknowledgement of Iran's hidden alcohol consumption, which has become - as Golnaz Esfandiari of Persian Letters puts it in her blog - a "means of escape" for the young from state restrictions, a senior official in the country's health ministry warned recently against reports of an increase in its use.