In January, a CIA contractor named Raymond Davis was brought up on murder charges in Pakistan after he shot two civilians. This week, he — or, more likely, the United States government — paid the family of the victims $2.3 million for the privilege of leaving the country. The murder case may now be closed, but it exposed the shadowy role the United States plays in the region and damaged U.S.-Pakistan relations. Here's a brief guide to the knotty case:

How did this get started?
The 36-year-old Davis shot and killed two men at a traffic light on January 27. He claims that a pair of motorcyclists attempted to rob him while he was driving, and that he acted in self-defense. But prosecutors say Davis shot one of his victims in the back, casting doubt on his account. Davis was arrested and spent ten weeks in jail.

Why was Davis in Pakistan?
The United States refuses to say, but experts believe he was sent there to run surveillance on Lashkar-e-Taiba, a shadowy militant group that is banned by the United Nations. Lashakr-e-Taiba, which translates to "army of the pure," is a complicated and secretive organization that, American experts say, has moved on from antagonizing India and become more focused on waging a jihadist war against the United States, Europe, and American groups in Afghanistan.

Why is Davis' case so controversial?
There's "resentment among Pakistanis who believe that a growing American security contingent roams the country with relative impunity," say Carlotta Gall and Mark Mazzetti at The New York Times. And the fact that American officials showed little remorse for weeks after the incident did not help matters. Despite the backlash resulting from Davis' arrest, though, the CIA has said it will not stop sending covert agents into Pakistan, and will not inform the Pakistani government how many agents are operating in the country.

Why was payment necessary to free Davis?
Paying off family members of the slain men was seen as a "last-ditch effort" to free Davis, after the high court of Lahore failed to grant him life-saving diplomatic immunity. Blood money, known locally as "diyya," is a common way to settle murder cases under Shariah, the Islamic code of law that decides many disputes in Pakistan. Eighteen relatives were in court to accept Davis's money, whereupon they told him that he had been forgiven. The United States is thought to have supplied the money, but denies having any involvement.

Is this the end of the story?
In normal circumstances, it would be. Last year, a diplomat in Islamabad hit a Pakistani child with his car and the U.S. embassy paid the family diyya, and the matter was closed. But in the Davis case, doubts linger about whether the family was coerced into accepting the money. After Pakistanis learned that Davis would be freed, lawyers and politicians organized small protests in Lahore and Karachi. "The high-profile nature of the case," says Issam Ahmed at The Christian Science Monitor, "means it could linger."

Sources: The New York Times, The Guardian, Christian Science Monitor, BBC