PRESIDENT MOHAMED MORSI retilted Egypt’s balance of power Sunday, two months after the ruling council of generals had tilted it too far in their own direction. This could prove a step toward a truly democratic Egypt, a positive turn of events. But there is a danger, too, for Mr. Morsi, the Muslim Brotherhood candidate who won the first free presidential election in Egypt’s modern history. He must respect others in a nascent civil society.

By any measure, the power grab by the council of generals was crude and offensive to the democratic aspirations of millions of Egyptians, who threw off Hosni Mubarak’s rule last year in the Arab Spring. Just as the polls closed in Egypt’s runoff presidential ballot in June, the military council stripped the presidency of power, seized authority to legislate until a new parliament is elected and to decide all matters related to the armed forces, and took a significant role in the writing of a new constitution.

On Sunday, Mr. Morsi returned those powers to himself. He also forced the country’s top two generals — both holdovers from the Mubarak years — into retirement and fired the chiefs of all the military services. Last week, he ousted Mr. Mubarak’s head of the security service. Mr. Morsi seems to have shrewdly capitalized on the Aug. 5 security debacle in which 16 Egyptian troops were killed by Islamist militants in the Sinai.

But Mr. Morsi will need to be more than shrewd if he is to lead Egypt in a democratic direction. His action against the generals was extralegal, and in a twilight period without a permanent constitution or parliament, he will have extraordinary sway, both legislative and executive, over how the new Egypt is constructed. The Muslim Brotherhood’s history as a closed, secretive society is not a viable method for governing.

Mr. Morsi probably had no alternative but to face off with the generals and consolidate his political standing. The military council would not have permitted a democracy to flourish. But Mr. Morsi must avoid the temptation of absolutism, and that means respecting other centers of power. He must still command a military establishment that has vast economic interests and is deeply rooted in the state. He must respect the secular and liberal forces who have been rivals to, and suspicious of, the Muslim Brotherhood.

Mr. Morsi also must learn to live with a certain amount of criticism. In recent days, the authorities announced prosecutions of journalists, some of them close to the military and not particularly sympathetic to Mr. Morsi. The president should not go down this road. He promised in a televised address on Sunday not to “narrow freedoms,” a pledge he must uphold at all costs if Egypt is to move beyond the stagnant authoritarianism of the Mubarak years.