Mohamed Morsi, the candidate of the Muslim Brotherhood’s Freedom and Justice Party, was announced on Sunday as the winner of Egypt’s first free presidential elections. Morsi defeated former Prime Minister Ahmed Shafik in a close contest by a vote of 51.7 percent to 48.3 percent.

Morsi now faces the difficult task of trying to lead a troubled nation facing a deepening economic crisis and bitter political disputes over the future structure of the Egyptian government, the role of Islam in politics, and how best to consolidate Egypt’s precarious democratic experiment. Shortly after the polls closed, Egypt’s interim military government stripped the presidency of much of its authority. Morsi will now enter office with weakened institutional powers and few political allies after the recently elected parliament was dissolved by a ruling of Egypt’s Supreme Constitutional Court.

The United States now finds itself in a double bind in Egypt: It will face challenges from a hostile Islamist president at the same time that a resentful military leadership operates behind the scenes to sabotage the difficult transition to a stable democracy. Neither the Muslim Brotherhood nor Egypt’s generals were favorably impressed by the Obama Administration’s quick abandonment of former President Hosni Mubarak and its fumbling efforts to support Egypt’s transition to democracy in the 16 months since Mubarak’s ouster.

Egypt’s military leaders may have concluded that there was little price to pay for hijacking the revolution and changing the political rules in the middle of an election because of the weak reaction of the Obama Administration to the crackdown earlier this year on U.S.-funded pro-democracy nongovernmental organizations (NGOs). Instead of freezing $1.3 billion in annual military aid, the Obama Administration waived congressional restrictions designed to penalize anti-democratic behavior and squandered whatever diplomatic leverage it had with Cairo’s new rulers.

Now the Muslim Brotherhood and the interim military regime, both of which are hostile to the ideals of political and economic freedom that initially sparked the rebellion, have outmaneuvered the weak liberal and secular movements that the Obama Administration predicted would end up on top.

The Administration could have strengthened Egyptian liberals and reformers by making a case for economic freedom and making it clear that attempts to restrict freedom would result in a reduction or complete halt in U.S. aid. But its spineless reaction to the persecution of U.S.-funded NGOs signaled to Egyptians that the Administration was willing to quietly sacrifice American values as well as national interests.