Zhang Yufen of the Alliance Against Mistresses, shown in 2008, carries out private detective work on behalf of wives to gather evidence of their husbands' infidelity, in order to win better divorce settlements. (Axelle de Russe)

When Zhang Yufen’s husband finally admitted to having an affair and left her to live with his mistress, clearing out his possessions and emptying their joint bank account, she felt as though the sky had fallen on her head.

But after a week in which she barely ate or slept, her pain and anger were channeled into a new determination: to find out who his mistress was, where they were living and why he had turned his back on 16 years of marriage — and to force him to provide proper financial support for her and their young son.

There was only one way to do that, she decided — good old-fashioned detective work — and only one person to do it, and that was her.

In the search for her husband and his mistress, and in her long court battle with them, Zhang embarked on a journey that led her to establish what could be China’s only women’s detective agency, working on behalf of wronged wives.

The corruption and decadence entwined with Communist Party rule here have fueled the phenomenon of the ernai, or second wife, and xiao san, literally the “little third,” or mistress. Party officials commonly have a mistress or multiple mistresses, showering them with luxury gifts and renting them plush apartments, all financed by the spoils of corruption. Research by scholars at Renmin University of China in 2012 found that 95 percent of officials under investigation for corruption were cheating on their wives.

Zhang Yufen, who works alone from her apartment just outside Beijing, says her work often brings her into conflict with corrupt Communist Party officials. (Simon Denyer/The Washington Post)

Their wives are often pushed aside, neglected and forgotten. Divorce carries stigma for a woman, although not for a man, and divorce law and the courts are often stacked in the husband’s favor. Zhang’s detective agency was an attempt to redress the balance.

“There is no protection for wronged wives,” she said. “In most cases they are left with no money, no house and no guarantees.”

Inspired by her own experience, Zhang in 1997 gradually started taking other people’s cases. Word of her work soon spread: She remembers being approached early on for help by an elderly woman whose daughter had drunk pesticide because her husband was cheating on her. “I asked her why they didn’t take the husband to court, and she said they didn’t have the evidence.”

To gather the evidence, Zhang established the Fire Phoenix agency in 2003 with nine friends, but she says she charged only for basic expenses, and a lack of finance eventually forced it to close.

These days, Zhang, 57, works alone from her small apartment outside Beijing, running the Alliance Against Mistresses, an organization that combines detective work with advice and advocacy for wronged wives. She still only charges for expenses.

Some have nicknamed this lively, talkative woman the ernai shashou, or “mistress killer.”

Over the years, she says, thousands of women have come to her for the evidence they need to prove their husbands were cheating — and to force them to pay compensation. But not all want to go to court.

Cheated women take pictures of themselves in 2008. At center is Zhang Yufen, who investigates husbands suspected of cheating on their wives. (Axelle de Russe)

“I understand why a lot of women don’t want a divorce,” she said. “In smaller places, people gossip. They often laugh at the wife, but they don’t necessarily judge the husband. She often feels shame and loss of face.”

Her methods are low-tech, labor-intensive and painstaking: While speaking, she showed off two hand-held tape recorders, two pairs of binoculars, a cheap camera and a notebook. She talks of hiding behind trees and electricity poles, of long stakeouts and of following her quarry in taxis and on foot.

In the course of investigating officials throughout China’s civil service, Zhang says she has been threatened with violence and arrest; her evidence has been thrown out of court by judges who are sympathetic to the husbands or in collusion with them.

But she has had successes.

In 2009, she was approached by the wife of a senior railway official, she says, and discovered that he was having an affair with a local television anchor.

“I told the wife to go there, and she caught them in bed together,” she said. “She grabbed her husband’s phones and found pictures of many women, and their phone numbers.”

Zhang said she found that he had 17 mistresses in the different cities where he worked. He was promoting his relatives inside the railway system and raking in huge kickbacks from construction contracts. His wife got the divorce, Zhang said, but the evidence of corruption was never admitted in court or acted on by his superiors.

In another case, Zhang helped a woman from Xi’an whose husband had divorced her. Despite his cheating, the judge had awarded him the family land.

Subsequently, and with Zhang’s help, the woman — who spoke on the condition of anonymity because she feared her remarks would be taken as criticism of the Communist Party — said she followed her husband for two years before finally tracking down where he lived, breaking in and gathering evidence of infidelity and corruption.

“It was really difficult because he had a car, and we had to move on foot and by taxi,” she said. “But Zhang and the other wronged wives stood up for me. Come heavy snow or scorching sun, they followed him, they never gave up.”

But Zhang says her efforts to expose official corruption often run into brick walls. One court mysteriously “lost” the evidence she had presented, while another, she alleges, warned the husband, who had time to empty a bank account of savings well beyond his earnings. Sometimes she presents evidence of corruption to an official’s boss, and the boss won’t want to listen, probably because he is corrupt himself, she says.

The profession of private detective was officially banned in 1993, although the business flourished, largely underground. Zhu Ruifeng, a “citizen reporter” who runs a Web site aimed at exposing corruption, said many people hire private detectives — mostly men — in marital cases.

“Often it’s the officials’ wives who want to protect their interests in case of a divorce; or to hold the evidence of infidelity as a card to secure the marriage; or sometimes mistresses have private detectives get evidence just in case,” he said.

In recent years, the work has become more dangerous. Even while President Xi Jinping wages a campaign against official corruption, the government has cracked down hard on freelance private eyes.

“It shows Xi’s anti-corruption campaign is highly selective, and aimed at clearing out those not on his side,” Zhu said.

In her simply furnished living room, Zhang reminisced about Communist China’s founder, Mao Zedong, and his era.

“Back in Mao’s time, we never used to lock our doors, and civil servants would serve the people,” she said. “Not like now — you would consider yourself lucky if they don’t gang up on you and fleece you. Everything is about money, and corruption is everywhere.”

But the woman from Xi’an said Xi’s anti-corruption campaign has given her hope that things might improve. Officials who used to spend their evenings at lavish banquets and in marathon drinking sessions at karaoke bars — with business associates and prostitutes — now worry about being exposed.

“People say Xi has saved many families, because officials now have to come home directly after work,” she said.

Zhang’s husband worked in the district taxation bureau in the city of Xi’an. She says she spent five years following him and his mistress, who turned out to be her best friend.

She tried unsuccessfully to sue him for bigamy. She finally won a divorce and received a payout in 2007. Later, she confronted her former husband and asked him why he had broken their marriage.

“He said: ‘Everyone in the taxation bureau had a mistress. I would have lost face if I didn’t have one.’ ”

Xu Yangjingjing contributed to this report.