Perhaps the most radical change in U.S. foreign policy under President Obama has occurred here in Egypt, where the Muslim Brotherhood, long shunned as a collection of dangerous Islamist extremists, is now the de facto object of American support.

Not only that: Ultraconservative Salafist politicians, who make the Brotherhood seem like moderate pragmatists, are now regular visitors to the U.S. Embassy and, on the theory that it is better to have them inside the tent than out, they are able to visit the United States to learn how things work in the land of Jeffersonian democracy.

Of course, the new American thinking goes, agreement will never be possible with these Salafis on women’s rights, for example, but this does not mean that they cannot have a mutually beneficial relationship with the West or evolve. Every Salafi in Parliament is one less potential jihadist.

The turnabout is dramatic. The United States consistently supported former President Hosni Mubarak, whose campaign against the Brotherhood was relentless. Prison for Brotherhood leaders was de rigueur. The Brotherhood occupied the space in American strategic thinking now taken by the Salafis — radical Islamists — with the difference that they were ostracized.

President Mohamed Morsi — who was of course imprisoned under Mubarak and was elected as Egypt’s first civilian leader in June — has ousted top generals with whom Washington and Israel were comfortable and installed his own men. The new chief of staff, Gen. Sedky Sobhi, while studying in the United States in 2005, wrote that American policy makers had shown a “fundamental lack of understanding and communication” with the Arab world. Some $1.5 billion in mainly military U.S. aid has continued to flow through this upheaval to Egypt.

Any prediction in Egypt today is hazardous. The nation at the heart of Arab society is in turbulent flux. As Tarek Shoeb, an Egyptian-American, put it to me: “There are a bunch of different streams, but it is not yet clear which one is the river.”

Still, I would argue that the United States has made the right choice; that this new policy of engagement with even extreme currents of political Islam in the Middle East is salutary; that the model should be extended; and that indeed the Obama administration had little choice. To keep doing the same thing when it does not work is one definition of madness.

What is the alternative to supporting Morsi and the Brotherhood and urging them to be inclusive in the new Egypt? Well, the United States could cut them off and hope they fail — but I can think of no surer way to guarantee radicalization and aggravate the very tendencies the West wants to avoid as a poverty-stricken Egypt goes into an economic tailspin. The same would be true of any attempt to install the armed forces again, with the difference that there would also be bloodshed.

The United States tried Middle Eastern repression in the name of stability for decades: What it got was terrorism-breeding societies of frustrated Arabs under tyrants. (Mohammed Atta came from Cairo.) The Brotherhood narrowly won a free and fair election. If they fail, throw them out next time. That’s democracy.

It is time to overcome the “fundamental lack of understanding and communication” of which General Sobhi wrote. That can only happen through working with the real forces of Arab societies rather than “Green Zone” fantasies.

Mitt Romney thinks Obama has been “passive” with the Islamists; aid could be slashed. But when aid is cut off, and American attention turns elsewhere, and future generals start getting their training in Saudi Arabia rather than Kansas, we know the result: Pakistan. That is not where the United States wants Egypt to end up. Turkey is a far better, if imperfect, model, and it is to Turkey and its governing Justice and Development Party that the Brotherhood is looking.

Morsi, who studied in California and breaks into English when impatient with his interpreters, has reached out to the United States from early in the transition — with trade requests, investment plans, vows to root out corruption, pleas to help get tourism back, and of course requests that aid be maintained. Even with little strategic alternative, America has leverage. It should be used to prod Morsi out of his Brotherhood roots toward the middle where the new Egypt must be forged. He appears ready to compromise.

America’s radical policy turnabout in Cairo poses an important question: Why is this engagement with political Islam, even in Salafist form, confined to Egypt? If Washington has discovered by engaging that the long reviled Brotherhood, or at least large swathes of it, may have evolved into centrist pragmatists, what other such discoveries may be made through dialogue rather than confrontation?

It is foolish for the United States to oppose reconciliation between the main Palestinian factions, Fatah and Hamas, when the spectrum of opinion there may be no greater than Egypt’s Brotherhood-Salafist front with which the United States now talks.

In Egypt, where almost 25 percent of Arabs live, the United States has at last begun to deal with the Arab world as it really is. Such taboo-breaking offers the only way forward — for Egypt and for Israel-Palestine.