ISLAMABAD, Pakistan — The Pakistani Parliament on Thursday passed laws to increase sentences for rapists and those who commit so-called honor killings of women, and closed a loophole that allowed many of the killers to go free, after hours of heated opposition from Islamist lawmakers.

Each year, hundreds of Pakistani women are killed by relatives angered by behavior they believe has impugned the family’s reputation, according to human rights activists, who have campaigned against the practice and called for tougher laws for years.

Most of those killings have gone without punishment because of a tenet of Islamic law that allows killers to go free if they are forgiven by the woman’s family — something that usually happens because the killers are usually family members.

“Under the new law, relatives of the victim would only be able to pardon the killer if he is sentenced to capital punishment,” Zahid Hamid, the law minister, said on the floor of the National Assembly. “However, the culprit would still face a mandatory life sentence.”