Matiuallah Achakzai, Associated Press
In this May, 16, 2014 photo, a Pakistani border guard stands alert as an excavator digs a trench along Pakistan Afghanistan border at Chaman post in Pakistan. ILike the Berlin Wall or Israel’s West Bank barrier, the planned 485-kilometer (300-mile) trench is giving physical form to a border that locals have long seen as artificial, dividing families and crippling trade. And it is adding to simmering tensions between Afghanistan and Pakistan, U.S. allies which have long accused each other of turning a blind eye to insurgents.

WASHINGTON — The U.S. has carried out a series of airstrikes in recent days against some of Pakistan's most wanted militants hiding in a remote border area, the latest sign of improving relations between the two reluctant allies after years of recrimination following the 2011 raid in Pakistan that killed Osama bin Laden.

On Nov. 24, an American airstrike in eastern Afghanistan narrowly missed Pakistani Taliban leader Mullah Fazlullah, a top target for Pakistan's military and the leader believed to have ordered the attack on schoolgirl Malala Yousafzai, a children's rights activist who survived and won the 2014 Nobel Peace Prize, a U.S. official said. The official was not authorized to be quoted by name discussing the clandestine operation.

Col. Brian Tribus, spokesman for the international coalition in Afghanistan, said the strike also killed three armed militants in Afghanistan's Nangarhar province.

The operation was one of a recent series along the Afghanistan-Pakistan border aimed at the group known as the Tehrik-i-Taliban Pakistan, according to U.S. officials who were not authorized to be quoted by name discussing the strikes. While the State Department considers that group a terrorist organization, it poses a far greater threat to Pakistan than to the United States, having killed thousands of Pakistanis.

The U.S. airstrikes are the latest indication that the U.S.-Pakistan counterterrorism alliance has recovered from the serious breach it suffered after al-Qaida leader bin Laden was found hiding in Pakistan in 2011 and the U.S. launched a secret operation to kill him without telling Pakistan in advance.

While neither government fully trusts the other, the relationship has fallen back into its old equilibrium of wary cooperation, according to several American military, diplomatic and intelligence officials who declined to be quoted discussing the sensitive topic. The counterterrorism alliance is considered crucial to the future of Afghanistan and the effort to destroy al-Qaida.

As it has for years, the U.S. continues to accuse elements of the Pakistani government of secretly supporting terrorists who serve its interests in Afghanistan. But the U.S. also provides Pakistan more than $2 billion a year in military and economic aid, and the countries work closely on some counterterrorism matters.

"U.S.-Pakistani military cooperation is on the upswing after a long period of tense dysfunction," said Rep. Adam Schiff, a California Democrat who serves on the House Intelligence Committee.

"We are on a much better trajectory," said a senior Pakistani military official who was not authorized to speak by name, but was expressing what he said was a widely held view in his government.

After a six-month pause while the Pakistan government pursued peace talks with the Pakistani Taliban, the CIA in June resumed drone strikes in Pakistan's tribal areas near the Afghan border. That policy is opposed by Pakistanis concerned about civilian casualties and the compromise of their sovereignty. But the pace of attacks is much slower than it used to be, and no civilian deaths have been confirmed in the 20 strikes recorded since, according to two organizations that track media reports of the attacks. Criticism in Pakistan has been far more muted than it once was.

The Pakistani military, meanwhile, this year conducted a major offensive against militants in the tribal region of North Waziristan, clearing a town, Miramshah, that once was a headquarters for the Haqqani network, a terrorist organization with links to Pakistan's intelligence service. It was a move that had been demanded for years by the U.S. government, which has accused Pakistan of playing a double game by fighting militants who threaten Pakistan while secretly backing those who threaten only Afghanistan and the U.S.

American officials and outside analysts say Pakistan supports the Haqqanis and other military groups as a way of retaining leverage over Afghanistan, where Pakistan's rival, India, wields significant influence.

Several U.S. officials said in interviews that the double game continues, because key Haqqani leaders were warned in advance about the offensive and decamped to Pakistani cities. Pakistan denies giving warnings. Either way, American military leaders in Afghanistan say the Pakistani army push has disrupted Haqqani operations and bodes well for future cooperation.

The Pakistan operation in North Waziristan has "fractured" the Haqqani network, Lt. Gen. Joseph Anderson, the deputy commanding general of U.S. forces in Afghanistan, told reporters in November.

Some Pakistan experts are skeptical that the country will ever stop supporting terrorists as proxies, something it denies doing.

C. Christine Fair, a Georgetown University professor who travels frequently to Pakistan, argues that militants have simply fled the Pakistani offensive into Afghanistan, where they can attack U.S. troops. She called the Pakistani offensive "a cynical magic show."

"Is it good that Miramshah is cleared?" she said. "Probably not bad, but it doesn't change the big picture."

Rep. Mike Pompeo, R-Kan., who serves on the Intelligence Committee, said Pakistan's military and intelligence services "have done some good work in and around Miramshah that will redound to the benefit of all of us." But, he said, "We need an awful lot more from them."