THE Middle East holds a giant chunk of the world's energy reserves, and also generates its biggest political headaches. Small wonder that the United States has long had an outsize interest in the place. Since September 11th 2001, and the rise of radical Islam as the sole violent challenge to an American-shaped international order, America's focus on the region between the Nile and the Indus rivers has been obsessive. Yet all the attention would seem to have been in vain. America's influence has dwindled everywhere with the financial crisis and the rise of emerging powers. But it seems to be withering faster in the Middle East than anywhere else.

Two decades ago, when America marshalled a daunting force to toss Saddam Hussein out of Kuwait, it stood unchallenged in the region. Kings and presidents-for-life vied for American favour. Countries such as Iran that would not, or Somalia that could not, were ignored. When America summoned leaders to Madrid in 1991 to sort out the most intractable Middle Eastern mess, the Arab-Israeli struggle, some grumbled, but all fell into line.

Most of them still come when America beckons, but ten years ago things began to slip. Despite the commitment of successive American presidents, and despite near-consensus worldwide on the outlines of an agreement, Arab-Israeli peace has kept receding out of reach. The invasions of Afghanistan in 2001 and Iraq in 2003 vastly expanded America's bootprint in the region. But the smoke of those Pyrrhic triumphs cleared to reveal America in trouble. The global “war on terror” declared by George Bush displaced al-Qaeda and prevented several serious attacks. But those successes drained America's treasury, alienated its friends and emboldened its enemies. Recalcitrant, revolutionary Iran found itself magically enhanced.

America's Middle East policy now looks thwarted at every turn. Its closest ally, Israel, which has received more than $27 billion in American military aid over the past decade, has rebuffed pleas, backed by offers of yet more aid and diplomatic support, to pause in its building of illegal Jewish settlements in occupied territory. Another Middle Eastern friend and aid recipient, Egypt, has cocked a snook at American requests to set an example of democratic reform. It rejected a call by Barack Obama to let international observers monitor a recent, garishly fraudulent election. Iraq, where America has expended so much blood and treasure, took nine months to form a shaky government that looks more to Iran's liking than America's. And Iran seems undiminished in its determination to pursue its nuclear ambitions, no matter how much America and its allies rattle sabres and pile on sanctions.

Even the popularity of Mr Obama, which surged among Arabs and Muslims after his inauguration, has fallen back. Shibley Telhami, of the University of Maryland who has long experience in polling regional opinion, notes two trends. Arabs used to distinguish between a dislike for American policies and a liking for Americans as people; now they tend to dismiss both. And when asked which leaders they admire, Arabs continue to cheer those who stand up to America and to its ally Israel. This year Turkey's Recep Tayyip Erdogan tops the list, followed by Hugo Chávez, Venezuela's yanqui-baiter-in-chief.

Several reasons lie behind America's loss of potency. Some reflect changes within the Middle East. Allies such as Israel and Turkey long followed American wishes reflexively because they felt imperilled and dependent on American largesse. They have now grown too strong for that. With its thriving economy, Israel feels able to take a more independent line. Turkey has also become an economic power and its government, unlike the dictatorships elsewhere in the Middle East, is now democratic. And although the region's two strongest states still pursue policies that dovetail with America's, they have grown unhelpfully estranged from each other.

Other allies that once augmented American power by proxy have grown too weak to help. Oil-rich Saudi Arabia packs financial clout, but its ruling princes are ageing and absorbed by a struggle for succession. Egypt, the most populous and diplomatically agile Arab country, is also run by old men. Once they could rally Arabs behind American objectives, but the Egyptians have struggled lately even to get the two main Palestinian factions, Hamas and Fatah, to talk to each other. The Mubaraks and the Al Sauds have little impact any more on the Arab Street: “resistance” and defiance carry more appeal. “The sense of how weak we are is a factor of how weak our partners are,” says Scott Carpenter, a Bush-administration official now with the Washington Institute for Near East Policy.

Fingers burned

America's own mistakes, tactical and strategic, have speeded its decline. The failure to find banned weapons in Saddam's Iraq and the torture at Guantánamo and Abu Ghraib have tainted America's moral authority. The application of American firepower has, ironically, also raised the bar for defying America's will. Iran and its allies, including Syria, Hamas and Hizbullah, the Lebanese Shia party-cum-militia, feel they can call America's bluff because they think that, having burned its fingers in Iraq and Afghanistan, it will no longer back harsh words with invasions.

You can see how they might reach that judgment. Aside from nearly 6,000 American fatalities in Iraq and Afghanistan, the expenditure, so far, of more than $1.1 trillion on military operations in those theatres has sapped the will for more campaigns. The cost of keeping a single soldier on the ground now exceeds $500,000 a year—a strong reason for a poorer America to reduce its presence in the region.

The incoming, Tea-Party-infused Congress is likely to make things harder. Whereas rivalry between Democrats and Republicans used to end at the water's edge, it now extends into foreign policy. Despite the ratification of the New START treaty at the end of 2010, Congress is beset by partisanship, even in petty matters. Solely because of partisan obstruction, Mr Obama has yet to secure approval for his choice of two career diplomats as ambassadors to Turkey and Syria.

America's pro-Israel lobby shows no sign of losing strength. Jonathan Broder, foreign-affairs editor of the Congressional Quarterly, discerns an effort by Republicans to woo Jewish voters, long more supportive of Democrats, by outbidding the administration over Israel. Eric Cantor, the incoming House majority leader, has proposed moving the $3 billion annual military grant to Israel from the foreign-aid budget to the Pentagon, in effect shielding it from spending cuts. “Not only would this remove a lever for American pressure,” warns Mr Broder, “it would make us silent accomplices in the settlement process.”

However, other Washington observers lament that the lessons of failure in the Middle East have yet to be learned. “Obama said that we had not only to change the war in Iraq, but to change the mindset that led to the war, and this has not happened,” says Brian Katulis of the Centre for American Progress, a left-leaning Washington think-tank. Despite a view that soft power can be as potent as military muscle, he says, this has not translated into policy. Marc Lynch, of George Washington University, agrees: “The lesson we seem to have learned from Iraq is not, ‘Disaster, don't do it again', but rather, ‘Now we know how to do counterinsurgency.'”

Picking up the pieces

America's woes have led some to accuse Mr Obama's team of managing the Middle East even more ineptly than Mr Bush's did. The American right and many Israelis think he is too pro-Arab. Arabs, Europeans and critics from the left charge him with being timid and oversensitive to domestic politics; with lacking strategic vision; with being locked into black-and-white views that overlook useful ambiguities; and with substituting lofty talk for firm action.

This is not entirely fair. As with the economy, Mr Obama took on a terrible inheritance from his predecessor. Iraq, Iran and Arab-Israeli peace were big burning fires when he took office. All have since been contained, to some extent, and largely by American efforts. Indeed, if damage-control was the mission, Mr Obama may claim a decent measure of success.

Mr Obama began with an assessment of what was wrong, and the steps needed to repair it. He expressed his urgency by appealing to Muslims through Arab media, in his impassioned Cairo speech in 2009, and by diplomacy to rebuild confidence with allied governments and on a smaller scale by expanding funding to civil-society groups and human-rights activists across the Middle East. Such initiatives can be hard to gauge, yet despite Mr Obama's falling regional approval and some worrying trends in public opinion, America's standing is better than it was in the Bush years. The number of Middle Easterners studying in American colleges, for instance, has nearly doubled in the past five years.

Improvement shows up, too, in the State Department's annual index of voting at the UN General Assembly. This has long revealed Arab states as the group least likely to vote with America. Voting coincidence stood at a peak of 40% under Bill Clinton. Under him it started to fall, reaching a feeble 10% in the Bush years. In 2009 Arab countries voted with America 20% of the time—not bad, considering that the average for all UN members was only 39%.

Thank you, neoconservatism

America's recent record on the big issues shows similar modest improvements. Iran's behaviour has still to change, but Mr Obama's mixture of diplomatic overtures and sticking to principles has left its rulers rattled and lonely. The administration's softer touch, says Karim Sadjadpour, an Iran expert at the Carnegie Endowment for International Peace, has solidified the transatlantic alliance, allowing for tougher sanctions. It has also widened divisions inside Iran that may accelerate the regime's demise. In any case, sharp changes are unlikely in a government so ideologically blinkered, diplomatically inept and administratively opaque as Iran's.

On Iraq, too, the administration's achievements have been undramatic, but important. Critics forget that America's declared aim is not to create a pro-American bastion but to leave a stable, inclusive and democratic government and to protect Iraqi sovereignty. The dramatic reduction in American troop levels, from 150,000 to below 50,000, has gone more smoothly than expected. Despite Iran's influence over some factions, neither it nor other foreign would-be meddlers have made huge inroads. Iraq's government remains shaky and venal, but it is now, in the eyes of most Iraqis, a legitimate, independent institution and it has, so far, been fairly inclusive. In short, it is too early to judge whether Iraq will prove a write-off for America, or a dearly bought long-term asset.

The biggest headache

It is harder to defend America's record in the Arab-Israeli talks, except to note that Mr Obama has shown more determination than Mr Bush. The president has been accused from the right of making too much of Jewish colonisation in the West Bank, in effect granting a veto to the far-right elements in the coalition led by Israel's prime minister, Binyamin Netanyahu. But the focus on settlements came in response to pleas from the weak Palestinian president, Mahmoud Abbas, to give him something to convince his people—understandably sceptical after two decades of pedalling to nowhere—that talks might work.

Still in the thick of it

The Obama team may have underestimated Mr Netanyahu's ability to resist. The White House was outfoxed in Washington, where the Israeli leader used the mid-term elections for Congress and pro-Israel Republicans to cow the administration. The effort to coax Israel with American gifts, say Mr Obama's defenders, was a recognition that action was urgent. “They saw a risk”, says Robert Malley of the International Crisis Group, “that if things don't happen in the next few months, they may lose two years in the run-up to the next US election, and have to kiss the whole Obama peace agenda goodbye.” This hiatus could affect a range of Middle Eastern issues, from Iran to Lebanon.

By this logic, the administration's willingness to pay to keep peace hopes alive can be seen as admirable commitment rather than feebleness. Israel may have outbluffed America, using the power of its supporters in Congress, but it stands increasingly isolated in the world. The next time America asks Mr Netanyahu for something it could, conceivably, rally allies to exert pressure too, and this could unsettle Israel. American diplomats have already moved to sustain momentum by arranging for parallel talks between the two sides. Their leadership is still needed; nobody else is likely soon to step into America's peace-processing shoes.

In fact, the Middle East's need for an active America is as great as ever. Don't forget that America's footprint spreads across the region, and in most places still rests on a comfortable carpet. Smaller states welcome American forces, accepting the need for protection much as Europe did after the second world war. Iran may declare that its objective is to chase America from the Persian Gulf, but it is Iranian recalcitrance that prompts its neighbours to host American bases and spend lavishly on American arms. Privately, most Iraqi leaders hope that American forces will stay. North African countries and Yemen quietly welcome American help against al-Qaeda.

America's present difficulties obscure longer-term successes. Gary Sick, who served on the National Security Council under Presidents Ford and Jimmy Carter and now teaches at Columbia University, sees oscillations rather than a declining influence in the Middle East. He recalls that in the Gulf, America had almost no permanent armed presence before the 1979 Iranian revolution. “We're on our way out of Iraq but not about to vanish,” he says, noting that al-Udaid, the American air base in Qatar, is the busiest in the world, and Dubai's Jebel Ali port the most frequently visited by the American navy. “If our main purpose has been to keep oil flowing, well, it works,” says Mr Sick. Another American target, global jihadism, is a work in progress; though in contrast to a decade ago, countering it is now a task that virtually every government in the world takes part in.

Yet even if America's influence endures, is it worth the price? Few Americans realise that the Persian Gulf nowadays supplies barely 10% of America's oil. Its value is far less than what the Pentagon spends on American fleets and bases in the region, even excluding the costs of war in Iraq and Afghanistan. America projects that over the next 25 years its dependence on Gulf energy will fall. Hence its armed muscle is, in effect, protecting the world from a Middle Eastern oil shock. That benefits America—because its consumers pay a world price for their oil. But it also benefits emerging rivals such as China and India, which shoulder none of the burden of serving as the world's policeman.

At the same time, the two things most consistently cited by Arabs and Muslims as their main objections to America—and which therefore serve as the biggest rallying calls to jihad—are its support for Israel and the regional presence of American forces. Neither of these is likely to change. That may one day lead Americans to ask why they invest so much in a troubled region with such poor returns.