The Indian rights activist Teesta Setalvad, center, with two women who lost family members in deadly riots in 2002 in Gujarat. CreditManpreet Romana for The New York Times 

MUMBAI — One of India’s best-known human rights activists, Teesta Setalvad, was brewing her morning tea on July 14 when she got a telephone call from her security guard.

“C.B.I. is at the gate, ma’am,” the guard said, referring to the Central Bureau of Investigation, the federal police.

Before long, 16 agents were searching her family’s compound on the shore of the Arabian Sea in Juhu, an upscale suburb of Mumbai. They searched all day, then all night, poring over Ms. Setalvad’s diaries, opening her jewelry boxes, digging through the linen closet. Not even the bedroom drawers of Ms. Setalvad’s daughter escaped scrutiny. The agents finally called it quits at sunrise, leaving with a haul of 3,179 documents.

Few critics have pursued the Indian prime ministerNarendra Modi, more doggedly than Ms. Setalvad, the driving force behind an unrelenting campaign to hold Mr. Modi criminally responsible for riots in 2002 that killed more than 1,000 people in Gujarat, the state Mr. Modi ran before becoming prime minister.

But on the eve of court proceedings that could leave Mr. Modi facing criminal charges for the riots, it is Ms. Setalvad who is feeling the heat from his government. In the past few months, as she has assembled evidence in the case, Ms. Setalvad has been discredited, financially drained and nearly overwhelmed by a merciless campaign of leaks and attacks emanating from entities controlled by Mr. Modi or his political allies.

First came the raid by the Central Bureau of Investigation, nicknamed “the caged parrot” for its history of doing the bidding of its political masters.

Days later, a prosecutor branded Ms. Setalvad a threat to India’s national security, so dangerous that she should be locked up while Mr. Modi’s government investigates whether it was legal for her to accept funding from the Ford Foundation.

Soon after, the state of Gujarat joined the rush to jail Ms. Setalvad, recipient of one of India’s highest honors, the Padma Shri Award. The state filed an affidavit in India’s Supreme Court accusing her and her husband, Javed Anand, of perpetrating a “colossal fraud” — to wit, raising $1.1 million “in the name of riot victims” only to siphon most of it to pay themselves exorbitant salaries and splurge on luxuries. The affidavit, while neglecting to mention that the Ford Foundation and other funders have found no evidence of financial wrongdoing, dwelled at length on the couple’s “conspicuous consumption,” noting, for example, that they had eaten at a Subway, and, in boldface type, describing the purchase of sanitary napkins.

To Ms. Setalvad and a growing chorus of supporters, the prosecutorial flurry is a pretext to humiliate and silence a prominent critic. Mihir S. Sharma, a columnist for The Business Standard, called it a vendetta that “looks like it’s being directed by Francis Ford Coppola.”

In news outlets sympathetic to Mr. Modi, however, the recent legal barrage is portrayed as an overdue comeuppance for an “anti-Hindu hatemonger” who uses foreign money to spread “antinational propaganda.” The public outcry, Mr. Modi’s allies argue, only proves that Ms. Setalvad is once again using her celebrity — in Indian newspaper headlines she is often simply “Teesta” — to shield herself from legitimate inquiries.

“If she has nothing to hide, she has nothing to fear,” said Nalin S. Kohli, a spokesman for Mr. Modi’s Bharatiya Janata Party.

For now, thanks to favorable judicial rulings, Ms. Setalvad and her husband remain free. But the damage to their cause has been considerable, she acknowledged during an interview at her home. Their organizations’ bank accounts have been frozen, their passports have been seized, their family savings are dwindling and they cannot afford to pay their lawyers. Worst of all, she said, they are so busy defending themselves — they have turned over 25,000 pages of financial records — that they have been distracted from their pursuit of Mr. Modi.

“It is a very heavy cost,” she said. “But at the moment, I’m still not thinking of backing away. It is too far down the road to back down.”

The Ford Foundation has also paid a steep price for its association with Ms. Setalvad. Since 2004, it has given $540,000 to Ms. Setalvad’s organizations, a small fraction of the $500 million it has spread to hundreds of groups here over the past six decades. According to Ms. Setalvad and the Ford Foundation, the money supported specific projects, like building an online archive of human rights cases. None of the money was used to build legal cases against Mr. Modi and other Gujarat officials, a point Ms. Setalvad and foundation officials say they have repeatedly made to government investigators who suspect Ford money was improperly diverted to fund political activism.

Even so, the foundation suddenly found itself the subject of damaging leaks to Indian news organizations. Starting in March, and continuing into summer, foundation officials learned from news accounts that they were under investigation by the federal Ministry of Home Affairs; that the state of Gujarat was accusing them of “abetting communal disharmony”; that new restrictions were being placed on foundation bank accounts; and that the government would have to approve any new grants.

Previous Indian governments have taken steps to curb the influence of foreign-funded nongovernmental organizations perceived as overly adversarial. But the Modi government’s actions were enough to provoke a rare public rebuke from Richard R. Verma, the United States ambassador to India, who said during a speech in New Delhi in May that he was worried about “the potentially chilling effects” of India’s crackdown on the Ford Foundation and other nongovernmental organizations.

Ms. Setalvad, 53, comes from eight generations of lawyers. Her grandfather, M. C. Setalvad, was India’s first and longest-serving attorney general. Her father, Atul Setalvad, was a renowned lawyer in Mumbai. Ms. Setalvad said it was Watergate and “All the President’s Men” that inspired her to pursue journalism instead. “I still have the book,” she said.

In 1993, as a response to months of bloody Hindu-Muslim riots in Mumbai, then called Bombay, Ms. Setalvad and her husband started a monthly magazine, Communalism Combat, dedicated to covering the manipulation of religion for political gain. (The magazine’s motto: “Hate Hurts. Harmony Works.”) More and more, their work blended journalism with activism, a transformation accelerated by the Gujarat riots of 2002.

Mr. Modi had been chief minister of Gujarat for only a few months when the violence began. On Feb. 27, 2002, just before 8 a.m., a train carrying Hindu pilgrims pulled into Godhra, a town with a large Muslim population. A scuffle broke out, stones were hurled, and then one of the train cars caught fire. The charred remains of 59 people were then put on public display in Ahmedabad, Gujarat’s largest city, inevitably stoking anti-Muslim fury.

For the next two months, as the Gujarat state police often sat idle, mobs of Hindus descended into savagery, hacking and burning Muslims to death, destroying Muslim homes by the thousands. The National Human Rights Commission, led by a retired chief justice of the Indian Supreme Court, called the state’s response to the riots “a serious failure of intelligence and action.” Mr. Modi’s government, the commission said, did not take basic steps to prevent violence and then failed to respond to specific pleas for protection. Mr. Modi, in an interview with The New York Times in 2002, said his only regret was not doing a better job of handling the news media.

Ms. Setalvad’s family is from Gujarat. The riots, she said, triggered in her a determination to break an age-old pattern in India: religious bloodletting followed by shoddy investigations that studiously avoid the leaders who stoke the rage in the first place. Two months after the riots began, Ms. Setalvad and her husband formed a new organization, Citizens for Peace and Justice, with the aim of shaming the authorities into doing a thorough investigation.

They began tracking down witnesses, demanding records and lining up lawyers for victims. They convened their own tribunal of retired judges to take public testimony and produce a scathing three-volume report. “Modi cynically tried to use the politics of division and violence to gain a fresh mandate from the people,” the report concluded.

The work of Ms. Setalvad’s network is widely credited with helping prosecutors win more than 100 convictions, the most notable resulting in a 28-year sentence for one of Mr. Modi’s former top lieutenants.

But the deeper they dug, the more vitriol and opposition they encountered. They were accused of taking “Arab money” and “brainwashing” riot victims. Death threats were as regular as the monsoon rains. It did not help when Ms. Setalvad promised with great fanfare to build a museum as a memorial to riot victims, only to cancel the project for lack of funds. Her penchant for overheated rhetoric also cost her support.

India’s Supreme Court has come to Ms. Setalvad’s rescue again and again.

When a witness in one of the riot cases accused Ms. Setalvad of kidnapping, the Supreme Court dismissed the witness as a “self-condemned liar.” When Ms. Setalvad was accused of coaching witnesses to make false allegations, Supreme Court justices repeatedly rejected the charge. In 2011, when the Gujarat government accused Ms. Setalvad of illegally arranging to have riot victims exhumed, the Supreme Court dismissed the case, calling it “100 percent spurious.”

When agents from the bureau raided her home, Ms. Setalvad and her lawyers quickly noticed something odd about the search warrant. Almost every document sought in the warrant had already been turned over to the authorities. Ms. Setalvad offered to spare the agents the trouble of searching by simply producing duplicates, but the agents said no.

It was then that Ms. Setalvad began to wonder if the real purpose of the search was the Jafri case.

During the Gujarat riots, one of the worst massacres took place at the Gulbarg Society, a Muslim housing complex where women and children took refuge in the home of Ehsan Jafri, a former member of Parliament. For hours, as attacks continued, Mr. Jafri placed phone calls seeking help and police protection. No help came, and Mr. Jafri and 68 others were murdered.

In the eyes of Mr. Modi’s critics, the Jafri case has always presented the best opportunity to prove his criminal culpability. But an investigative panel appointed by the Supreme Court concluded in 2012 that there was not enough “prosecutable evidence” to charge him.

It is this ruling that Mr. Jafri’s widow, Zakia Jafri, is now trying to overturn on appeal with help from Ms. Setalvad. “If this appeal is upheld, the prime minister of India is liable to be tried on the charge of conspiracy for his handling of the 2002 carnage,” said Manoj Mitta, a senior editor at The Times of India who has written a book about the riots.

The appeal is scheduled to be heard over the coming weeks before Gujarat’s highest court. This, Ms. Setalvad said, may explain the timing of the agents’ raid at her home.

“What I’m not worried about is them finding anything incriminating against us,” she said. “I’m worried they’ll find things we have that incriminate them.”