Image caption The lack of women's rights under the Taliban helped to justify western military intervention in Afghanistan

Hundreds of Afghan women are in jail for "moral crimes", including running away and extra-marital sex, Human Rights Watch (HRW) has said.

In a report, it said that women were punished for fleeing domestic abuse and violence while some rape victims were also imprisoned.

Sex outside marriage - even when the woman is forced - is considered adultery, another "moral crime".

TheI Had to Run Away reportwas released in Kabul on Wednesday.

The report said that the government of President Hamid Karzai had failed to fulfil its obligations under international human rights laws.

"It is shocking that 10 years after the overthrow of the Taliban, women and girls are still imprisoned for running away from domestic violence or forced marriage," HRW Executive Director Kenneth Roth said.

The report called on the government to release about 400 women and girls held in jails or juvenile detention centres.

"Some women and girls have been convicted of zina, sex outside of marriage, after being raped or forced into prostitution," it said.

The treatment of women and girls accused of 'moral crimes' is a black eye on the face of the post-Taliban Afghan government and its international backers, all of whom promised that respect for women's rights would distinguish the new government from the Taliban HRW I Had To Run Away report

"Judges often convict solely on the basis of 'confessions' given in the absence of lawyers and 'signed' without having been read to women who cannot read or write.

"After conviction, women routinely face long prison sentences, in some cases more than 10 years."

It said that the situation had been made worse by Mr Karzai frequently changing his position on women's rights.

"Unwilling or unable to take a consistent line against conservative forces within the country, he has often made compromises that have negatively impacted women's rights."

Earlier this month the president endorsed a "code of conduct" issued by an influential council of clerics which allows husbands to beat wives under certain circumstances.

The BBC's Emily Buchanan says that the lack of women's rights under the Taliban helped to justify Western military intervention in Afghanistan in 2001.

Our correspondent says that since then there has been much progress on girls access to education and participation in public life.

Many activists fear that hard-won rights are increasingly being undermined as the government tries to woo conservative religious forces.