by Ray Locker and Kendall Breitman, USA TODAY

by Ray Locker and Kendall Breitman, USA TODAY

Rifts in the relationship between the United States and Pakistan, aggravated by the 2011 raid that killed Osama bin Laden and other incidents, are gradually mending, just as U.S. troops are planning their departure from neighboring Afghanistan by the end of the year.

Starting with the visit of Pakistani Prime Minister Nawaz Sharif to Washington last October, there have been increasingly more and higher level meetings between the two troubled allies.

This week, Sartaj Aziz, Pakistan's national security adviser, met with Secretary of State John Kerry and Susan Rice, President Obama's national security adviser, to discuss economic, energy and military issues.

"On the whole, the [U.S.-Pakistani] relationship is on an upward trajectory," Aziz said.

That's a change from 2011, when ties between the two countries couldn't get much worse.

In January 2011, CIA contractor Raymond Davis was arrested by Pakistani authorities after he shot and killed two men after a traffic incident in Lahore. Davis was eventually freed after protracted negotiations between the two countries.

On May 1, 2011, U.S. Navy SEALs raided the compound of al-Qaeda leader Osama bin Laden in Abbottabad, home of the Pakistani military academy. Bin Laden was killed during the raid for which U.S. officials gave Pakistan no warning. Pakistani officials protested and angrily denied claims the nation's intelligence agency knew where bin Laden was living.

Pakistan's help is considered critical to the future of Afghanistan, as support for that nation's Taliban insurgents has often come from Pakistan. But the Pakistani government has made gains in the last year in cutting some of the flow of chemicals used to make improvised explosive devices (IEDs) in Afghanistan.

James Clapper, the U.S. director of national intelligence, told a Senate committee Wednesday that Pakistan "wants good relations with the United States, but cooperation with Washington will continue to be vulnerable to strains, particularly due to Pakistani sensitivities toward perceived violations of sovereignty."

Along with Aziz's meetings this week and Sharif's October visit, other steps drawing the nations closer include:

â?¢ Defense Secretary Chuck Hagel visited Pakistan last month to discuss security issues, including the bilateral security agreement between the United States and Afghanistan. The agreement, which Afghan President Hamid Karzai, has not signed, is critical to the future presence of U.S. troops in the country.

â?¢ Obama signed an executive order on the strategic partnership between the United States, Pakistan and Afghanistan on Jan. 17.

Despite the recent movement, it's still too early to declare the relationship between the two nations fully mended, said Daniel Markey, an expert on Pakistan at the Council on Foreign Relations.

Compared to 2011, Markey said, things are much better. Then, "diplomatically we reached a rupture point. But the fact that the prime minister got all of these meetings, and now Aziz is getting similar excellent meetings, this show that the U.S. government is serious about fixing this relationship."

Former Defense secretary Robert Gates, in his new memoir Duty, issued an additional cautionary note about relations with Pakistan. He described a 2010 trip to Pakistan after which he concluded: "The visit was for naught. I returned convinced that Pakistan would work with the United States in some ways - such as providing supply lines through Pakistan, which were also highly profitable - while at the same time providing sanctuary for the Taliban and other extremists, so that no matter who came out on top in Afghanistan, Pakistan would have influence. ... I knew they were really no ally at all."

U.S.-Pakistani ties have long been viewed through the lens of other relationships. Since 1979, much of U.S. Pakistan policy focused on how Pakistan could help deal with Afghanistan, which was invaded that year by the Soviet Union. That concern regained momentum after the Sept. 11, 2001, attacks and the subsequent U.S. invasion of Afghanistan.

In the late 1960s and early 1970s, President Richard Nixon relied on Pakistan to help open diplomatic relations with China. During the 1980s, the Reagan administration poured resources into Pakistan because of its help supporting groups fighting the Soviet occupation of Afghanistan.