Who ousted Mohamed Mursi? It turns out that the future of Egypt -- and perhaps of regional peace -- depends on whether removing a president after popular protests counts as a military coup or not.

The Foreign Assistance Act requires the suspension of all U.S. aid to a country when the “duly elected head of government is deposed by military act or decree” -- no exceptions unless a democratic election is later held. If President Barack Obama wants to continue $1.55 billion in annual aid to Egypt, his lawyers will have to do some fancy legal footwork to explain why he gets to ignore a law designed precisely to deter an army from doing what Egypt’s did.

U.S. assistance to Egypt derives from the Camp David accords, in which Anwar Sadat was rewarded by the U.S. for making peace with Israel. Sadat used the aid to sustain his unpopular rule, a strategy adopted by Hosni Mubarak after Sadat’s assassination.

Any Egyptian government would have trouble ruling without the U.S. aid. Most of the money goes to the military, which, as a result, boasts state-of-the-art equipment and a whole shadow world of gated neighborhoods, clubs and stores -- not to mention the prestige of being a second-world institution in a decidedly third-world country. To take all this from the army would destabilize the institution. The military must have believed that bringing down Mursi, Egypt’s first leader who could honestly be called “duly elected,” wouldn’t result in a suspension of aid.

Worrisome Assurances

Here is where things go squirrelly. Egypt’s army has extremely close ties to its U.S. counterparts. General Abdelfatah al-Seesi wouldn’t have gambled his institutional power base on the judgment of anonymous Obama administration lawyers. It seems likely that he had assurances from General Martin Dempsey, the chairman of the Joint Chiefs of Staff, whom he reportedly spoke with before ordering Mursi removed. If they were given, such assurances would have been legally wrong, politically unwise and constitutionally worrisome.

Start with the law. Mubarak was “voted” into office in a rigged system that assured his easy victory. His removal shouldn’t have led to a cessation of aid -- and it didn’t. What’s more, a genuine democratic election followed relatively soon after, curing any legal defect that might have existed.

Mursi was genuinely elected -- and genuinely deposed by a military that was the only force in the country that could bring him down. Sure, the protesters also wanted him out. But as he himself made clear, he wasn’t going anywhere as a result of the protests. Plenty of Egyptians wanted him to stay in power. The crowds weren’t about to storm his palace and lead him out Nicolae Ceausescu-style. If it were not for the army, Mursi would still be president, albeit of an embattled nation. This was a coup -- and if wasn’t, then nothing is.

The precedent is clear, too. I wrote a detailed independent report with co-authors in 2011 detailing how the Honduran military removed Manuel Zelaya from power, an event that the Obama administration eventually ruled was a coup. Mursi’s removal was even more clearly a coup than what happened in Honduras, where the president had violated the constitution already and the army acted with the agreement of the legislature and the courts.

In fact, the whole reason the law exists is to deter a coup like this one -- which is why it would be terrible policy to wink at its violation. If we wanted the president to decide which coups he liked, we wouldn’t need the law. It is supposed to tie the president’s hands, forcing the U.S. to support democratic values and to guide militaries like Egypt’s that rely on U.S. aid.

Obama’s lawyers have played fast and loose before, and extended executive power by denying that the air campaign in Libya represented “hostilities” and by claiming that internal deliberations before killing Americans by drone were a species of “due process.” This time, they should follow the spirit and the letter of the law. If Congress wants to support the Egyptian army, it can do so -- by voting an exception to the Foreign Assistance Act, not by weakening its own constitutional power and democracy itself.

(Noah Feldman, a law professor at Harvard University and the author of “Cool War: The Future of Global Competition” and “The Fall and Rise of the Islamic State,” is a Bloomberg View columnist. Follow him on Twitter at @NoahRFeldman.)

To contact the writer of this article: Noah Feldman at nfeldman@law.harvard.edu.

To contact the editor responsible for this article: Nisid Hajari at nhajari@bloomberg.net.