Defenders of the legislation say it is an improvement on the tribal laws which normally decide family matters.
Al Jazeera's Todd Baer, reporting from Kabul, said: "At one point it did appear that these protests would spill out of control but riot police were on hand and were able to keep everything under control."
In March, Hamid Karzai, the Afghan president, signed the law, which applies only to the country's minority Shia population, but it has yet to be published.
Karzai ordered a review of the legislation after criticism from the United Nations and countries including Canada and the United States, who say it violates international equality laws.
|Supporters of the law say many of its elements have been misinterpreted [AFP]
Barack Obama, the US president, has labelled the law "abhorrent".
Karzai has said anything that violates women's rights would be removed from the legislation, but supporters argue that many of the contentious points have been taken out.
"We don't want foreigners interfering in our lives. They are the enemy of Afghanistan," Mariam Sajadi, a supporter of the legislation, said.
Sajadi said controversial articles in the law - such as one giving the husband the right to demand sex from his wife every fourth day - have been misinterpreted by Westerners.
Mohammad Hussain, one of the people who confronted the critics of the law, said: "Opposing this law is opposing Islam, the religion and the constitution."
Critics allege that the law allows marital rape by stopping a wife from refusing sex and prevents her from leaving her home without her husband's permission except on urgent business.
Wadir Safi, a law professor at Kabul University, told Al Jazeera that the law must be rewritten as it does not conform with either the constitution or Afghanistan's civil law.
"The public opinion of the Shia people has not been asked for, especially not from the females," he said.
"It really violates not only the constitution, but also the human rights of the Shia female. The terms are not in line with international rights that have been accepted in the constitution."
The Taliban, who ruled Afghanistan from 1996-2001, required women to wear all-covering burqas and banned them from leaving home without a male relative.