Pakistani human rights activist Asma Jehangir in June 2017. (K.M. Chaudary/AP)

She was branded a traitor to Islam and her homeland, accused of blasphemy, attacked by angry mobs and thrown into prison. She was hailed as a courageous crusader, awarded dozens of international honors, nominated for a Nobel Peace Prize and described as “the gutsiest woman” in Pakistan.

For more than three decades, Asma Jehangir, a sharp-tongued activist and erudite attorney, was Pakistan’s leading human rights lawyer and champion. She spoke out for women abused in the name of honor, defended non-Muslims harassed as infidels, denounced religious extremism and marched for democratic freedoms under a dictatorship.

She died Feb. 11 of a heart attack after being taken to a hospital in the Pakistani city of Lahore, her lifetime home, her family announced. She was 66.

Ms. Jehangir often seemed to be everywhere at once — a vocal and visible presence at many historic public confrontations in Pakistan over military rule, religious intolerance and cruel traditions. Her barbed, witty comments in hundreds of news conferences, TV interviews and, more recently, tweets delighted liberal fans and infuriated conservative critics.

To be a successful activist lawyer, she once noted, one must “have an eye for what’s hot, the right case, the right bench.”

One high-profile moment came in 2007, when Pakistan’s dignified legal community launched a street protest movement to demand an end to military rule under Gen. Pervez Musharraf. At the time, Ms. Jehangir was chairing the independent Human Rights Commission of Pakistan. A state of emergency was declared, and she was among key protest leaders placed under house arrest.

A decade later, long after democratic rule was restored, she was still denouncing the power of Pakistan’s military and intelligence establishments and the facade of civilian control. In a lecture at Oxford University in 2017, she charged that “the military controls the country through the deep state,” while “the politicians are playing at democracy, hanging onto the cliff with their claws. And then the boot comes.”

Ms. Jehangir was a pioneer for women’s rights in Pakistan, founding the country’s first all-female law firm with her sister Hina Jilani in 1987. Over the years, she took on religious laws that blamed rape victims as adulterers; fundamentalist Islamist groups that sought to suppress women; family and cultural traditions that trapped them in abusive marriages; and traditional village councils that meted out rapes and lashings as punishment for suspected illicit relations.

In 2005, she was detained in Lahore for organizing a street race to protest a government ban on women participating in marathons; the ban had been announced after violent opposition from hard-line Islamist parties. Police surrounded her office at the human rights commission, arrested her with other activists and hustled them into vans as a crowd watched. In the process, she recounted, security agents began to strip off her clothes.

“When they were putting me in the police van, they assured that my photograph was taken while my back was bare,” Ms. Jehangir said. “This was just to humiliate, this was simply just to humiliate me.”

Her early activism was forged as a young woman during the repressive military rule of Gen. Mohammed Zia ul-Haq in the 1980s, when she was arrested and imprisoned for protesting Zia’s harsh “Islamization” policies and curtailment of women’s rights.

Soon, she was taking on legal cases that thrust her into the public eye but also involved violence, prison and death threats. In one case, she defended a blind adolescent girl who was raped, accused of fornication and sentenced to be flogged and imprisoned. The ruling was overturned, but at one point, Ms. Jehangir was arrested.

In 1999, she was approached for legal advice by a woman named Saima Sarwar, who had fled an abusive husband and sought a divorce that was opposed by her family. Sarwar was visiting Ms. Jehangir’s and Jilani’s law office in Lahore when Sarwar’s parents and another man entered. Sarwar was shot dead.

A secular-minded Muslim, Ms. Jehangir defended the rights of Christians and other minorities throughout her career, denouncing the abuse of blasphemy laws against them. Once, while representing a Christian boy sentenced to death for blasphemy against Islam, she was attacked by a mob outside the courthouse.

She also pressed for legal reforms to protect the rights of bonded laborers, who often spend years trapped by debt to owners of brick quarries, textile looms or wheat fields, and she lobbied for the enforcement of widely ignored laws against child labor.

As news of Ms. Jehangir’s death spread Sunday, Pakistan’s top civilian officials and many others praised her courage and persistence in the cause of human rights. Jilani told Pakistan’s Geo News TV that her death was “not just the family’s loss but also of those who are voiceless and whose voices she raised.” Legal associations across Pakistan announced three days of mourning.

One widely shared tweet came from Malala Yousafzai, 20, the Pakistani activist for girls’ education who was nearly assassinated by Taliban militants as a teenager. She was awarded the Nobel Peace Prize in 2014 and is now studying at Oxford.

“The best tribute to her,” Yousafzai tweeted, “is to continue her fight for human rights and democracy.”

Asma Jehangir was born in Lahore on Jan. 27, 1952, the daughter of a Pakistani legislator from an upper-class family. She graduated from Lahore’s Kinnaird College for Women and in 1978 received a law degree at Punjab University, also in Lahore.

She co-founded the Human Rights Commission of Pakistan and was president of the Supreme Court Bar Association. She served on several missions for the United Nations and won international awards. In addition to her sister, survivors include her husband, Tahir Jehangir of Lahore; two daughters and a son.