Existing federal law may force the U.S. government to do something previously proposed by Rand Paul: cut off foreign aid to Egypt.

Under Section 508, “none of the funds appropriated or otherwise made available pursuant to this Act shall be obligated or expended to finance directly any assistance to any country whose duly elected head of government is deposed by a military coup or decree.”

While President Obama has been careful to avoid labeling the ouster of democratically elected Egyptian President Mohamed Morsi a coup, the provision is not subject to presidential waiver.

Last year, Paul introduced legislation to suspend foreign aid to Egypt, Libya, and Pakistan. After the Senate overwhelmingly defeated his bill, Paul ran ads against swing-state Democratic senators who voted against it.

“While they tear down and burn the American flag in Egypt and shout ‘death to America’,” said the narrator in the spot that ran in West Virginia, “Joe Manchin votes to provide U.S. taxpayer aid to Egypt.”

Paul also tried unsuccessfully to block the sale of fighter jets and tanks to the Egyptian government. “I think it particularly unwise to send tanks and our most sophisticated fighter planes to Egypt at a time when many are saying the country may be unraveling,” he said on the Senate floor.

The Senate thought otherwise, rejecting Paul’s amendment by a vote of 79 to 19. Every vote in favor, however, came from fellow Republicans.

According to most polls, the public stands with Rand on foreign aid. Of course, voters have an exaggerated sense of how much international assistance really costs in the grand scheme of the massive federal budget.

Foreign aid accounts for less than 1 percent of federal spending. (A 2011 CNN poll found that most Americans thought the figure was closer to 10 percent, with one in five believing it was closer to 30 percent.) But it can be pretty expensive in terms of the trouble it buys.

Years of propping up Hosni Mubarak’s regime in Cairo bought the U.S. the undying enmity of anti-Mubarak protestors, many of whom voted for the Muslim Brotherhood and other Islamists. Similarly, the anti-Morsi demonstrators who helped topple the government last week were chanting against Obama as well, resenting the administration’s apparent support for a leader they despised.

With Morsi gone, the tables on aid to Egypt have turned somewhat. With the military benefiting rather than the Muslim Brotherhood, many Republicans are reluctant to cut off aid. House Majority Leader Eric Cantor called the army “a key partner of the United States and a stabilizing force in the region.”

Sen. Bob Corker, the ranking Republican on the Senate Foreign Relations Committee, also sounded supportive of sending American tax dollars to Egypt’s military. “Our long-standing cooperation with Egypt, which is essential for stability in the region, should remain a priority,” he said in a statement.

Many foreign-policy experts regard the aid as America’s main source of leverage in Egypt, fearing that policymakers will have fewer options short of military involvement without it. Although Paul argued that sending tanks and planes to Egypt endangered Israel, AIPAC actually quietly opposed his amendment.

But this is clearly a case of U.S. taxpayer dollars funding both sides of a conflict—and arguably alienating all sides of the region’s population in the process. When the subject was aid to Israel, Paul once said, “You have to ask yourself, are we funding an arms race on both sides?”

In this case, we face the options of funding a democracy that might empower parties holding anti-American views, supporting a military government that suppresses democracy, or funding elements that are less illiberal but lack democratic legitimacy.

Oddly, one Republican senator who may now be on Paul’s side is John McCain. “Reluctantly, I believe that we have to suspend aid until such time as there is a new constitution and a free and fair election,” McCain said on CBS’ “Face the Nation.”

McCain, an advocate for democracy promotion, originally did not want the Muslim Brotherhood involved in any transition government. Now he says their overthrow must trigger a chance in U.S. policy.

“It was a coup, and it was the second time in two-and-a-half years that we have seen the military step in,” the old maverick said. “It is a strong indicator of a lack of American leadership and influence.”

Yet the reaction of a bipartisan gaggle of other senators on the Sunday talk suggests Washington is likely to try very hard to wriggle out of its legal bind on aid to Egypt, and it is possible that Congress will move to waive foreign-aid stipulations in this particular case.

Paul and McCain might make a strange bedfellows’ coalition on Egypt aid. More telling will be where grassroots conservatives stand now that the Muslim Brotherhood is gone.

W. James Antle III is editor of the Daily Caller News Foundation and author of Devouring Freedom: Can Big Government Ever Be Stopped?