Islamabad, Pakistan (CNN) -- A CIA contractor who killed two Pakistani men was released from jail Wednesday after compensation was paid to the victims' families, the result of an intense diplomatic tug-of-war that strained ties between the United States and its all-important ally Pakistan.

Raymond Davis -- who has now left Pakistan, according to a U.S. official not authorized to speak for attribution -- had been in jail since January. But the families of two men he killed forgave him, a government official said Wednesday.

"The families of the victims ... have pardoned Raymond Davis," said Cameron Munter, the U.S. ambassador to Pakistan. "I am grateful for their generosity. I wish to express, once again, my regret for the incident and my sorrow at the suffering it caused."

The U.S. official told CNN that Davis is now in Kabul, Afghanistan, for medical examination and rest. Davis' wife in Colorado was notified of Pakistan's decision soon after his departure from there, the source said.

The episode illustrated U.S. consternation with Pakistan, and initially sparked rage in the Asian nation over the killings.

The United States -- pressuring its key ally in the fight against al Qaeda and the Taliban to release Davis -- at one point sent Sen. John Kerry to Pakistan to meet with officials there, and members of Congress told Pakistani leaders that billions of dollars in U.S. aid were in jeopardy unless Davis was released.

It is not known who paid the compensation to the families, and there are conflicting reports over the amount. A lawyer closely connected to the case said the compensation was $1.4 million, but Punjab province law minister Rana Sanaullah said $2.34 million was paid to the legal heirs by the U.S. government.

The U.S. official not authorized to speak for attribution insisted that the release of Davis was a decision made by the Pakistanis, and that there was "no quid pro quo" between Washington and Islamabad. The official refused to comment on whether there was a exchange of so-called "blood money."

It was Pakistani officials who worked with the family in making the arrangements for what is referred to as "blood money," the official told CNN.

The United States "did not sit across from the families" to work out an arrangement, but the official acknowledged there were "interagency discussions and a policy decision" -- in other words a White House sign off -- for the United States to agree to the arrangement, the official said.

Secretary of State Hillary Clinton, who said "we are very grateful" for the decision of the families that enabled Davis "to leave Pakistan and head home," stressed that the U.S. government didn't pay any compensation to the families and she wouldn't say whether the Pakistanis or a third party did.

"We also have a Department of Justice investigation that has begun into what happened in Lahore. And we've communicated our strong support for the relationship between Pakistan and the United States, which we consider to be of strategic importance," Clinton said during a press conference Wednesday.

Sanaullah first told Pakistani media Wednesday that the victims' families did not want to press charges and added soon after that Davis was free to go.

The statement came just hours after the American was charged with murder in connection with the January shootings.

Sanaullah later said $1,169,500 was paid to 11 legal heirs of one victim and the same amount was paid to eight legal heirs of the others.

Davis appeared in the Lahore court after the payment was made and was acquitted of the charges, in accordance with an Islamic practice known as diyat, or compensation, the lawyer said.

"Diyat," a part of Islamic law that is enshrined in Pakistan's penal code, allows victims to pardon a murderer with or without being paid "blood money," the former chief justice of Pakistan's Supreme Court, Saeed U Zaman Saddiqi, told CNN.

On a second charge, illegal possession of a firearm, Davis was fined $250 and sentenced to time already served, the lawyer noted.

According to Davis, the January 27 shooting occurred after two men attacked him as he drove through a busy Lahore neighborhood, the U.S. Embassy has said.

The United States had been seeking the release of Davis from a Lahore jail on the grounds that he has diplomatic immunity.

But a high court in Pakistan refused Monday to decide whether the CIA contractor has diplomatic immunity, sending the case back to a lower court, the official Associated Press of Pakistan reported.

The lower court had already ruled that Davis does not enjoy protected diplomatic status because neither he nor the Pakistani government has provided documents proving that he does.

U.S. officials originally said Davis was a diplomat and later revealed that he is a CIA contractor, intensifying the already highly charged situation.

Pakistan is a key U.S. ally in efforts against al Qaeda and the Taliban in neighboring Afghanistan, and the shooting deaths outraged many Pakistanis.

CIA spokesman George Little said Wednesday the agency and its "Pakistani counterparts have had a strong relationship for years.

"When issues arise, it's our standing practice to work through them," Little said in a statement.

"That's the sign of a healthy partnership -- one that's vital to both countries, especially as we face a common set of terrorist enemies."

The U.S. Justice Department has opened an investigation into the incident and department spokeswoman Laura Sweeney said it "will take all necessary and appropriate law enforcement steps in our ongoing criminal investigation."

"Due to the ongoing nature of this investigation, we aren't in a position to provide additional details at this time," Sweeney said.

In Highland Park, Colorado, Davis' wife, Rebecca, spoke to reporters outside the couple's home. She appeared relieved and animated about her husband's possible return home within the next week or so.

She told reporters that she wouldn't cry but she became tearful when she spoke about how U.S. government officials supported her, even staying in contact on Valentine's Day and the couple's anniversary. The couple met at Fort Bragg, North Carolina, she said.

"Everybody laughs about my intuition but I just knew in my gut that he would be home," Rebecca Davis said.

While in jail, he sent her letters saying, " 'I love you. I miss you.' This is not something he would wish on his worst enemy," she said.

"It wasn't a pleasant thing, but it could have been so much worse," Rebecca Davis said.

CNN's Pam Benson, Adam Levine and Michael Martinez and journalists Nick Paton Walsh and Nasir Habib contributed to this report