When Sadegh married his college sweetheart, he never thought he'd end up as one of those Iranians facing ruin and even prison because of huge sums demanded by his wife's family.
But the "mehrieh" ("affection") system, in which future husbands agree to pay a certain number of gold coins to the bride in the event of divorce, has left thousands of men in Iran languishing in jail and many more destitute.
"Our mehrieh was high, around 800 gold coins, but when we were planning the wedding, we didn't think about how it might end," said Sadegh, who was divorced last year after eight years of marriage.
Each gold coin is worth around 10 million rials ($300). A worker on Iran's average wage would need 50 years to earn 800 gold coins.
"Even when the problems started and we talked about separation, it was supposed to be mutual and no mehrieh was going to be paid," said Sadegh, who spoke to AFP on condition that his full name not be used.
But then his wife's family got involved, and suddenly Sadegh found himself in court where he was told to pay 110 coins immediately or go to jail.
"The thought of ending up in prison for this, like in the movies, seemed ridiculous," he said.
"Mehrieh is good as a financial support for women in a patriarchal society like Iran, but it has become a business."
Pleading he was broke, the judge brokered a deal in which Sadegh agreed to pay the equivalent of 120 coins, one per month.
That meant a decade of payments, each taking just under half his photographer's salary.
Then, five months in, he lost his job.
- 'Sword over man's head' -
It could have been even worse. At last count, the judiciary said some 2,297 men were in jail for failing to pay their mehrieh after a divorce.
A glimmer of hope surfaced this week in Tehran, where a ceremony was held to celebrate the work of donors who pay off the debts of prisoners as a show of Islamic charity.
They have freed 1,700 mehrieh-convicts over the past year.
"Unfortunately, today competition among families has led to ever-increasing mehrieh," said Hadi Sadeghi, a cleric and judiciary official who helps coordinate the releases.
He said mehrieh, whose level is negotiated by the families at the time of a couple's engagement as per ancient Islamic custom, had lost its simple traditional function as a form of dowry for the newly-weds to buy furniture.
Now the payment is usually delayed and brandished against men as a threat in case of divorce, or even worse, is used by unscrupulous families for extortion.
"The worst case is when families turn it into a business. Boys need to be careful not to be deceived," said the cleric.
"Using mehrieh as a sword over the man's head is wrong too. It only leads to more arguments and divorces."
Officials agree that mehrieh has in recent decades degenerated into a status symbol, and that families are often just too stubborn to back down when a marriage falls apart.
"Many families, when they go to wed their girls, their first question is mehrieh," said Alireza Afsary, who runs a foundation supporting prisoners.
"Some laws need to be amended and some cultural and social issues need to change."
The courts have tried to intervene, saying they will only force husbands to pay a maximum of 110 gold coins, but even this is beyond the means of many Iranians.
- Way to redress balance -
Still, many women see mehrieh as a way of redressing the balance for divorced women, who are often shunned by society.
Some exchange mehrieh for promises they will be allowed to work or study, or have child custody in the event of a divorce.
"A woman who gets married is always afraid of not having real rights at the time of separation, so she tries to guarantee her rights through mehrieh," said Safi, a married woman in her 20s.
But all agree it has done nothing to slow soaring divorce rates in Iran as the country modernises and women enjoy increased freedoms. There were more than 165,000 this year, up 15 percent compared to five years ago.
"If they are looking for ways to support women, and for men to show loyalty to their families, they should have new rules... for example giving them a legal right to half the man's property," said another young woman, Shima, 28.
As for Sadegh, he is trapped, still having to come up with 10 million rials a month despite being unemployed. He missed the last payment. The threat of prison hangs heavy over him.
"We were classmates and were together for a year or two before marriage. Her family said they have a tradition of high mehrieh and couldn't reduce it. My family tried to refuse, but I loved her so we didn't insist.
"We thought everything was going to go on smoothly forever."