Correction: An earlier version of this article misstated the Obama administration’s budget request for military and economic aid to Pakistan in fiscal 2013. The proposed amount is $2.2 billion, not $3.5 billion. This version has been corrected.

A supporter of Pakistani religious group Jamaat-ud-Dawwa stands on a representation of a U. S. flag before set it on fire during a protest rally in Karachi, on April 6, 2012. (AP)

When Defense Secretary Leon E. Panetta was asked on a visit to India last week why Pakistan had not interfered with the U.S. operation to kill Osama bin Laden, he answered with a grin.

“They didn’t know about our operation,” Panetta said as the audience of Indian defense experts broke into laughter. “That was the whole idea.”

The joke did not go over well next door. “I view it as an intended insult,” a senior Pakistani military official said of Panetta’s “ridicule” while on the territory of Pakistan’s traditional enemy. Panetta “let it rip again” the next day in Afghanistan, the official said, when he said at a Kabul news conference that the United States was “reaching the limits of our patience with Pakistan.”

“It is not the exclusive domain of the United States to lose its patience,” the Pakistani official said darkly.

Years of mutual mistrust and tactical mistakes, now complicated by upcoming elections in both countries, have brought the strategic relationship between the United States and Pakistan closer than ever to a dead end that neither appears able or willing to avoid.

The Obama administration considers Pakistan key to resolving the Afghan war and wants its nuclear arsenal tethered to a solid U.S. partnership. Pakistan remains dependent on U.S. military and economic assistance and wants a prominent role in whatever happens in Afghanistan.

Yet the two countries appear to have reached a stalemate on issues that have long divided them — from the U.S. use of armed drones on Pakistani territory to Pakistan’s continued harboring of the Taliban and other groups affiliated with al-Qaeda, and countless matters in between.

On Monday, a Pentagon team came home empty-handed from Islamabad after a months-long effort to negotiate the reopening of Pakistani border crossings for the transit of NATO supplies into Afghanistan. While nearly all elements of an agreement are in place, Pakistan has renewed a demand that the United States apologize for the incident that led to the border closing.

The administration has said it “regrets” the deaths of 24 Pakistani soldiers killed by U.S. airstrikes in an inadvertent border skirmish in November. But a Pentagon investigation found both sides at fault, and the White House, despite State Department urging, has refused to authorize the use of what one U.S. official called “the ‘sorry’ word.”

“It took us by surprise,” a senior administration official said of Pakistan’s renewed demand for an apology. The official said the matter is being debated again by President Obama’s top national security advisers, but there seems little cause for optimism. U.S. and Pakistani officials spoke on the condition of anonymity lest they be blamed for igniting yet another firestorm.

The November incident is only the most recent of repeated clashes and perceived slights over the past 18 months, none of which has been fully resolved. Last year began with the shooting death of two Pakistanis by a CIA contractor the administration insisted was a “diplomat,” continued with the U.S. Navy SEAL raid on the Pakistani compound where bin Laden was found to have lived unmolested for six years, and ended with the border air raid.

Electoral politics have made the long-running struggle for equilibrium even more difficult, as both governments face political and public opposition to their continued engagement.

Despite the increasingly hard line taken by the White House, many U.S. lawmakers have accused Obama of coddling Pakistan despite its many perceived sins. Some have called for canceling major elements of the $2.2 billion in military and economic aid the administration has requested for fiscal 2013.

Mitt Romney, the presumptive Republican presidential nominee, regularly criticizes Obama’s Afghanistan strategy, while saying little about Pakistan. But according to his campaign Web site, Romney would “not be shy” about using U.S. leverage there to attain desired aims.

The Pentagon, under pressure to validate Obama’s Afghanistan troop withdrawals with demonstrable progress in the war, increasingly blames Pakistan for its woes. Several U.S. military officials drew a direct line between Panetta’s impatience and a June 1 suicide bomb attack on a large NATO base in eastern Afghanistan’s Khost province that was blamed on the Pakistan-based Haqqani militant network.

Assuming that Pakistani President Asif Ali Zardari remains in office until elections that must be held by March, he will preside over the first transfer of power from one elected leader to another since Pakistan’s 1947 founding. But Zardari’s economic advisers have warned that the country may go broke months before then and have urged a fall election that would allow the government under Prime Minister Yousuf Raza Gilani to avoid taking full blame for the predicted financial debacle.

Pakistan’s constitution requires a transition government to take over three months before an election. That would give Zardari’s Pakistan People’s Party time to regroup before the campaign shifts into gear.

But aside from the economic aspects, the prospect of an early election has increased pressure on the government to remain steadfast against what Pakistani public opinion sees as U.S. arrogance and bullying. In the wake of the November deaths, Pakistan’s parliament drew up new guidelines for the relationship, including the demanded U.S. apology, an end to territorial violation by drones, and a new payment structure for the transit of NATO supplies.

Washington considers only the last of these within the realm of the possible, and has tried to separate the border negotiations from the far more difficult question of drones.

When it looked as if a transit deal was near this spring, the administration rewarded Zardari with an invitation to NATO’s May summit in Chicago. But after Obama refused to meet with him there, the deal was set aside as each charged that the other had once again reneged on promises.