Despite obvious American sympathy for Mr. Mubarak’s security concerns, there is little evidence that the diplomats believed the president, now 82, was at risk of losing his grip on power. The May 2009 cable noted that riots over bread prices had broken out in Egypt in 2008 for the first time since 1977. And it said the growing influence of the Muslim Brotherhood had prompted the government to resort to “heavy-handed tactics against individuals and groups.”

But the cable, again signed by Ambassador Scobey, portrayed Mr. Mubarak as the ultimate survivor, a “tried and true realist” who would rather “let a few individuals suffer than risk chaos for society as a whole.”

“During his 28-year rule,” the cable said, “he survived at least three assassination attempts, maintained peace with Israel, weathered two wars in Iraq and post-2003 regional instability, intermittent economic downturns, and a manageable but chronic internal terrorist threat.”

Another cable, dated March 2009, offered a pessimistic analysis of the prospects for the “April 6 Movement,” a Facebook-based group of mostly young Egyptians that has received wide attention for its lively political debate and helped mobilize the protests that have swept Egypt in the last two days. Leaders of the group had been jailed and tortured by the police. There were also signs of internal divisions between secular and Islamist factions, it said.

The United States has defended bloggers with little success. When Ambassador Scobey raised several arrests with the interior minister, he replied that Egypt did not infringe on freedom of the press, but that it must respond when “people are offended by blogs.” An aide to the minister told the ambassador that The New York Times, which has reported on the treatment of bloggers in Egypt, was “exaggerating the blogger issue,” according to the cable.

American diplomats also cast a wide net to gather information on police brutality, the cables show. Through contacts with human rights lawyers, the embassy follows numerous cases, and raised some with the Interior Ministry. Among the most harrowing, according to a cable, was the treatment of several members of a Hezbollah cell detained by the police in late 2008.

Lawyers representing the men said they were subjected to electric shocks and sleep deprivation, which reduced them to a “zombie state.” They said the torture was more severe than what they normally witnessed.