“If you want to judge the performance of the Egyptian people by the standards of German or Chinese or American culture, then there is no room for judgment,” he said. “When the Egyptians decide something, probably it is not appropriate for the U.S. When the Americans decide something, this, of course, is not appropriate for Egypt.”

He suggested that Egypt would not be hostile to the West, but would not be as compliant as Mr. Mubarak either.

“Successive American administrations essentially purchased with American taxpayer money the dislike, if not the hatred, of the peoples of the region,” he said, by backing dictatorial governments over popular opposition and supporting Israel over the Palestinians.

He initially sought to meet with President Obama at the White House during his visit this week, but he received a cool reception, aides to both presidents said. Mindful of the complicated election-year politics of a visit with Egypt’s Islamist leader, Mr. Morsi dropped his request.

His silence in the immediate aftermath of the embassy protest elicited a tense telephone call from Mr. Obama, who also told a television interviewer that at that moment he did not consider Egypt an ally, if not an enemy either. When asked if he considered the United States an ally, Mr. Morsi answered in English, “That depends on your definition of ally,” smiling at his deliberate echo of Mr. Obama. But he said he envisioned the two nations as “real friends.”

Mr. Morsi spoke in an ornate palace that Mr. Mubarak inaugurated three decades ago, a world away from the Nile Delta farm where the new president grew up, or the prison cells where he had been confined by Mr. Mubarak for his role in the Brotherhood. Three months after his swearing-in, the most noticeable change to the presidential office was a plaque on his desk bearing the Koranic admonition, “Be conscious of a day on which you will return to God.”

A stocky figure with a trim beard and wire-rim glasses, he earned a doctorate in materials science at the University of Southern California in the early 1980s. He spoke with an easy confidence in his new authority, reveling in an approval rating he said was at 70 percent. When he grew animated, he slipped from Arabic into crisp English.