US officials have provided fresh details about Raymond Davis, the CIA agent at the centre of a diplomatic stand-off in Pakistan, including confirmation that he had worked for the private security contractor Xe, formerly known as Blackwater. They also disclosed for the first time that he had been providing security for a CIA team tracking militants.

Davis was attached to the CIA's Global Response Staff, whose duties include protecting case officers when they meet with sources. He was familiarising himself with a sensitive area of Lahore on the day he shot dead two Pakistanis.

The New York Times, Washington Post, Associated Press and other media outlets reported for the first time that Davis is a CIA employee. They said they had been aware of his status but kept it under wraps at the request of US officials who said they feared for his safety if involvement with the spy agency was to come out. The officials claimed that he is at risk in the prison in Lahore. The officials released them from their obligation after the Guardian on Sunday reported that Davis was a CIA agent.

Davis shot dead two Pakistanis in Lahore last month who he says had been trying to rob him. A third Pakistani man was killed by a car driven by Americans apparently on their way to rescue Davis.

Confirmation that he worked for Xe could prove even more problematic than working for the CIA, given the extent of hatred towards Blackwater, whose staff have gained a reputation in Pakistan as trigger-happy. For Pakistanis the word "Blackwater" has become a byword for covert American operations targeting the country's nuclear capability. Newspaper reports have been filled with lurid reports of lawless operatives roaming the country.

US officials have reiterated their concern about Lahore's Kot Lakhpat jail where Davis is being held, saying he had been moved to a separate section of the prison, that the guards' guns had been taken away from for fear they might kill him, and that detainees had been previously killed by guards. They are also concerned about protesters storming the prison or that he might be poisoned, and that dogs were being used to taste or smell the food for poison.

However, the authorities in Pakistan stressed the stringent measures they have put in place to protect Davis in Kot Lakhpat following angry public rallies in which his effigy was burned and threats from extremist clerics.

PJ Crowley, the US state department spokesman, said: "Obviously, we are concerned about his safety. We have had multiple conversations with the government of Pakistan regarding his current surroundings. They have told us that he is in the safest possible location in Lahore. And clearly, we hold the government of Pakistan fully responsible for his safety."

Surveillance cameras are trained on his cell in an isolation wing, and a ring of paramilitary troops are posted outside. About 25 jihadi prisoners have been transferred to other facilities.

The revelations about Davis will complicate further the impasse between the US and Pakistan. Washington says he has diplomatic immunity and should be released but the Pakistan government is in a bind, facing the danger of a public backlash if it complies.

Until Sunday, the US had said Davis was a diplomat, doing technical and administrative work at the embassy. It says that because he has diplomatic immunity, he should be released immediately.

The Pakistani prime minister, Yousaf Raza Gilani, told parliament on Monday he would safeguard the country's "sovereignty and dignity" as it sought to resolve the diplomatic impasse with the US. "We are firmly resolved to adopt a course that accords with the dictates of justice and the rule of law. My government will not compromise on Pakistan's sovereignty and dignity," said Gilani.

The Obama administration is exerting fierce pressure on Pakistan to release Davis. But President Asif Ali Zardari's government, faced with a wave of public outrage, has prevaricated on the issue, and says it cannot decide on immunity issue until 14 March. For many Pakistanis the case has come to represent their difficult relationship with the US, in which multibillion dollar aid packages are mingled with covert activities targeting Islamist extremists.

Davis is currently on Pakistan's "exit control list", meaning he cannot leave the country without permission. But the two men who came to his rescue in a jeep that knocked over and killed a motorcyclist are believed to have already fled the country. Davis claimed to be acting in self-defence, firing on a pair of suspected robbers. But eyebrows were raised when it emerged that he shot the men 10 times, one as he fled the scene.

Pakistani prosecutors say Davis used excessive force and have charged him with two counts of murder and one of illegal possession of a Glock 9mm pistol. There have also been claims that the dead men were working for the Inter-Services Intelligence (ISI) agency, with orders to follow Davis.

The military spy agency cooperates with the CIA in its tribal belt drone programme, but resents US intelligence collection elsewhere in the country.In spite of the lurid conspiracy tales in Pakistan about Blackwater, US officials say that in reality Blackwater has had two major contracts in Pakistan - loading missiles onto CIA drones at the secret Shamsi airbase in Balochistan, and supervising the construction of a police training facility in Peshawar. The Davis furore has not, however, stopped the controversial drone strike programme. News emerged of a fresh attack on a militant target in South Waziristan, the first in nearly one month. Pakistani intelligence officials told AP that foreigners were among the dead including three people from Turkmenistan and two Arabs.

Rocky relations

The CIA and Pakistan's ISI have long had a rocky relationship. It started in the 1980s jihad, when the ISI funnelled billions of dollars in CIA-funded weapons to anti-Soviet rebels in Afghanistan.

But the two fell out in 2001 over CIA accusations that the ISI was playing a "double game" – attacking some Islamist militants while secretly supporting others.

In August 2008 the CIA deputy chief, Stephen Kappes, flew to Islamabad with evidence suggesting the ISI plotted the attack on the Indian embassy in Kabul that killed 54 people. The ISI, in turn, complained that the US came with unrealistic expectations and an aggressive attitude.

Yet at the same time the agencies co-operated closely, mostly on the CIA drone campaign against al-Qaida militants along the Afghan border.

In 2009 the ISI praised the CIA for killing the Pakistani Taliban leader Baitullah Mehsud. But recently things soured again. Last December the CIA station chief was forced to quit Pakistan after being publicly identified (US officials blamed an ISI leak); while Pakistani spies were angered that their chief, General Shuja Pasha, was named in a US lawsuit brought in a New York court by victims of the 2008 Mumbai attacks.

Declan Walsh