BEIJING — For months, Chen Guangcheng, one of China’s best-known dissidents, played a cat-and-mouse game with the phalanx of guards encircling his home. He dug a tunnel to try to escape, a friend says, but was found out. And he sneaked out a video that alerted his supporters to the beatings he said he and his wife suffered at the hands of the men who kept them virtual prisoners in their rural farmhouse.

Then last Sunday night, in an improbable escape, Mr. Chen, who is blind and reportedly weak from months of mistreatment, scaled the wall that has been built around his house, slipped past his security detail and made a desperate sprint to apparent safety in Beijing. The daring rush for freedom could not have been possible without a small network of activists who risked detention to help him and who, supporters with knowledge of the escape said, used coded messages to communicate and elude a surveillance apparatus that is one of the world’s most pervasive. By Saturday, three activists had disappeared, including the woman who drove Mr. Chen 300 miles to Beijing and a man who admitted to meeting the dissident as he was shuttled between safe houses in the capital. The man’s wife said he was taken away by the police.

Friends of Mr. Chen, along with people in the Chinese government, say he is now inside the American Embassy in Beijing. If true, that creates diplomatic headaches for the United States just days before Secretary of State Hillary Rodham Clinton and other American officials arrive for annual talks.

That the underground network of activists was able to help Mr. Chen evade his captors and move around the capital undetected for days has undoubtedly shaken Chinese leaders, who have become increasingly determined to suppress dissent through technology and brute force. Friends say his escape was so well executed that local officials did not realize until Thursday that he was gone.

“His escape is nothing less than a miracle,” said Zeng Jinyan, a human rights campaigner who also spent time with Mr. Chen last week.

Mr. Chen’s flight could not have come at a worse time for China’s leaders, who were already struggling with the humiliation inflicted by the case of Bo Xilai, the center of a cascading scandal that cost him his seat in the Politburo and exposed a level of mistrust among top officials in the one-party state.

News of Mr. Chen’s improbable odyssey has electrified China’s rights activists, scores of whom had sought for months to draw attention to his plight and to challenge his extralegal detention by flocking to Dongshigu village in futile attempts to see him. The journeys, many of them publicized through social media, always ended the same way: the guards paid to keep Mr. Chen and his family incommunicado would use violence to drive visitors away.

Mr. Chen, 40, has long been a cause célèbre among human rights advocates both in China and abroad. A self-taught lawyer who was illiterate well into his 20s, Mr. Chen earned renown by defending disenfranchised peasants and the disabled. But he infuriated local family planning officials in Shandong Province after filing a class-action lawsuit on behalf of women forced to undergo abortions and sterilizations.

In 2006, he was convicted on charges that many legal experts say were trumped up. After serving his 51-month sentence, he was escorted back to Dongshigu, where local officials were determined to keep him silent. They turned his home into a makeshift prison, encircling it with guards, surveillance cameras and a jamming device to ensure he could not communicate with the outside world. His wife and young daughter were also confined to the house, although she was later allowed to attend school accompanied by guards.

Many details of the escape remain murky, but supporters say Mr. Chen may have been aided by a sympathetic guard. They also say that the night before his escape, he was able to discuss his plans with supporters via cellphone — a remarkable detail given how hard the guards had worked to keep him isolated.

The friends said Mr. Chen’s subterfuge was months in the making. In recent weeks, they said, he stayed in bed continuously to convince his minders that he was too weak to walk, or to try to leave.

As part of the plan, his wife stayed behind to distract the guards stationed outside their front door.

After he scaled the wall outside his home, he hid somewhere before making his way to a predetermined pickup spot almost a day after leaving home. It was then that He Peirong, a rights activist from Nanjing, arrived in her car and drove Mr. Chen to Beijing, according to the account she posted on her microblog account.

“Now Chen Guangcheng is either in a safe place or in the hands of State Security in Beijing,” she wrote Friday morning shortly before the authorities in Nanjing arrived at her home and took her away. Ms. He remained unreachable on Saturday and her microblog account has been disabled.

According to Hu Jia, a well-known dissident and AIDS activist who met with him in Beijing last week, Mr. Chen, who had arrived in the capital on Monday, spent the subsequent three days protected by a loose network of supporters who made sure he slept in a different apartment each night.

Mr. Hu, who himself has been under constant surveillance said the network consisted of five people. After several frantic days, he said, “It was decided that there was only one place in China that is absolutely safe, and that’s the U.S. Embassy.”

He said he was certain that Mr. Chen had made it to the embassy because on Friday he received a predetermined coded message confirming that Mr. Chen had made it there.

China Aid, a Christian organization in Texas, also helped in the effort to bring Mr. Chen to safety. Although he would not provide much detail of that assistance, the president of China Aid, Bob Fu, said he was in frequent contact with Mr. Chen in Beijing.

Even as they celebrated Mr. Chen’s flight, activists worried about the backlash that appeared to be building. On Thursday night, Mr. Chen’s brother was taken away by the local authorities, who were also said to be seeking to arrest his son. Human rights advocates say they fear that Mr. Chen’s wife and mother may also be in grave danger.
Several of those who assisted Mr. Chen or publicly advocated on his behalf have also been detained. In addition to Ms. He, the activist who drove him to Beijing, Guo Yushan, a scholar in Beijing, has been missing since Friday, after telling friends he was being trailed by security agents. And shortly after talking to a reporter on Saturday, Mr. Hu, the AIDS activist, was taken away by the police, his wife said.

Nicholas Bequelin, a senior researcher at Human Rights Watch, said Mr. Chen’s escape highlights the organizational prowess of Chinese rights activists in the face of increasingly sophisticated surveillance. But he acknowledged that the success came at a price.

“It’s hard to call this a victory if everyone involved in his escape ends up detained, arrested and imprisoned,” he said.