Despite nationwide protests by hard-liners, President Gen. Pervez Musharraf on Friday signed into law an amendment to the country's controversial rape statute to make it easier to prosecute sexual assault cases.

Human rights activists have long condemned Pakistan's old law for punishing — instead of protecting — rape victims while providing legal safeguards for their attackers.

The new legislation, known as the Protection of Women Bill, was supported by Musharraf's government as part of efforts by Islamabad to soften the country's hard-line Islamic image and appease moderates and human rights groups who opposed the old law.

The changes take effect immediately, Federal Minister for Parliamentary Affairs Sher Afghan said during a nationally televised broadcast.

"It has been done to safeguard the rights of women," Afghan said.

The law was enacted even as thousands of religious conservatives rallied against the changes at several protests around the country.

Click here to go to FOXNews.com's Asia Center.

Islamists gathered by the hundreds at separate events in the southwestern city of Quetta, the eastern city of Lahore and the city of Rawalpindi, just south the capital Islamabad.

Under the new law, which was approved last week by Parliament, judges can choose whether a rape case should be tried in a criminal court — where the four-witness rule would not apply — or under the old Islamic law, known as the Hudood Ordinance.

It also drops the death penalty for sex outside of marriage. The offense would now be punishable with five years in prison or a fine of $165.

International and local calls for change intensified after the 2002 gang-rape of a woman who was assaulted after a tribal council in her eastern Punjab village ordered the rape as punishment for her 13-year-old brother's alleged affair with a woman of a higher caste.

Hundreds of opposition supporters have rallied against amending the old laws, which were introduced by late President Gen. Zia ul-Haq to make Pakistani legislation more Islamic.

Opposition leader Senator Khurshid Ahmed, from a six-party coalition of Islamic groups known as the Mutahida Majlis-e-Amal, or United Action Forum, has condemned the changes as "an attempt to promote an alien culture and secularism in Pakistan."