A court in Pakistan has released a convicted rapist after agreeing to marry the victim, according to his lawyer.

Victims and perpetrators are from the same extended family, lawyer Amjad Ali told the AFP news agency on Wednesday.

The relatives were reconciled after an out-of-court marriage settlement was reached with the help of a traditional council of elders.

Human rights activists were shocked.

The 25-year-old was arrested after his victim gave birth to a baby and a test identified him as the biological father.

In May he was sentenced to life imprisonment by a court in the north-west of the country for raping the deaf woman.

The local provincial high court has now accepted the deal with the rape victim's family, allowing the man to be released on Monday.

In essence, the court is condoning rape, lawyer and human rights activist Imaan Sainab Masari-Hasir told AFP.

"It goes against the basic principles of justice and against the law of the country that does not recognize such a regulation." The Pakistani Human Rights Commission was also outraged.

Rapists are rarely convicted in Pakistan.

According to the Asma Jahangir Legal Aid Cell, less than three percent of the cases that go to court result in convictions.

In addition, rape is rarely reported because of the social stigma associated with it.

Omissions in investigations and out-of-court settlements do the rest.

In rural Pakistan, local councils of elders called “Jirga” or “Panchayat” bypass the judicial system.

However, their decisions have no legal validity.