In China, Ms. Karolys said, the Mexican consulate took her under its wing, finding her a cheap place to stay and a computer she used to search for clues. Her sense of urgency reached a new pitch about a month after the abduction, when she discovered a Web site called “Rodrigo Karolys’s LiveJournal” where since 2001 Mr. Karolys had periodically vented his anger, described his own lies, sexual relationships and drug use, and crowed about fleeing the police in America.

“That’s when I realized I didn’t know him at all, and I had to rescue my daughter from him because she was in danger,” said Ms. Karolys, who came to the United States at age 11, met her husband in 2004 and married him two years later.

A Feb. 11 posting, which became part of Ms. Karolys’s affidavit in support of her petition for custody, said: “I ran away with my daughter when we were in Beijing. I just couldn’t let her grow up to be a lazy worthless waste of space like her mother.” He added, “I sent my kid to live with her new mom in another city.”

Ms. Karolys had no idea who this “new mom” was, but in New York, her sister combed the Internet to find out. In March, she discovered YouTube videos and MySpace photos that Mr. Karolys had posted of Lenora with his Chinese girlfriend, and matched the woman’s image to that of a fellow teacher at Mr. Karolys’s school. She also found his Jan. 29 Craigslist posting for a baby sitter in Shanghai, and sent everything to the F.B.I.

Image Rodrigo Karolys with his girlfriend in China.

Discouraged by all the delays, Ms. Karolys’s parents, who are housekeepers, went into debt to hire a private investigator in China. He provided surveillance photos and an address outside Shanghai, where Ms. Karolys, accompanied by a Mexican consular official, Tadeo Berjon, showed up on April 17, despite opposition by the United States Embassy and the New York lawyers.

“When confronted, Rodrigo attacked both Olivia and the Mexican Embassy official with two knives, one in each hand,” the Sanctuary lawyers wrote in a summary of the case. The Chinese police arrested everybody, then let Mr. Karolys go, saying that no harm had been done.