US official Raymond Davis on Lahore murder charges
A US consular employee has appeared in court charged with the murder of two motorcyclists who were shot dead in the Pakistani city of Lahore.
Raymond Davis told the court he had fired his gun in self-defence.
Another person was run over and killed by a vehicle carrying Mr Davis's colleagues as they came to his aid, police and witnesses have said.
The US embassy has not named the man involved in the shooting or given his role in the Lahore consulate.
It said in a statement that a staff member had been involved in an "incident yesterday that regrettably resulted in the loss of life".
"The US embassy is working with Pakistani authorities to determine the facts," the statement added.
The BBC's Syed Shoaib Hasan, in Pakistan, says a last-minute change of plan for security reasons meant that Mr Davis appeared in court in a neighbourhood within Lahore's military garrison.
He had earlier been due to appear in a court in central Lahore.'Robbers'
Mr Davis told the court he still feared for his life and asked it to provide necessary security. He was remanded in custody for six days.
Lahore's police chief, Aslam Tareen, told the BBC Mr Davis was employed on "security duties" in the consulate.
Mr Davis has been charged with murder under section 302 of Pakistan's law. This means that if the charges against him are proved, he faces life imprisonment and a possible death sentence.
However, if Mr Davis is a bonafide US government employee with diplomatic status, under the Vienna convention of 1961, he cannot be prosecuted. The US would need to waive his diplomatic status, for which there is thought to be no precedent.
However, there will be great pressure on the US authorities who have promised to co-operate with Pakistan in the investigation.
He did not have diplomatic immunity and was not one of the foreign security personnel allowed to carry firearms, according to the Pakistani authorities.
Mr Tareen said a Glock pistol had been recovered from Mr Davis and that pistols had also been found on the two men shot dead.
Mr Davis is said to have told police that the motorcycle rider and his pillion passenger had been trying to hijack his vehicle at gunpoint.
Police said he told officers that he had withdrawn money from a cash machine shortly before the incident.
Pakistani investigators have said the two men were probably robbers, although relatives dispute this.
The funerals of the three people killed in the incident were expected to take place on Friday.
More than 100 protesters blocked the road in the aftermath of Thursday's incident, setting tyres ablaze.'Rambo goes berserk'
Demonstrators later gathered outside the police station where the foreigner's car - a white Honda Civic with a Lahore registration plate - was impounded.
Details of the shooting are still unclear, but a salesman, Mohammad Ramzan, told Dawn newspaper that he had seen a foreigner rushing from a car holding a gun.
"Within seconds he trained his gun at two motorcyclists standing at the Qurtaba Chowk traffic signal and opened fire," Mr Ramzan said.
Police said that the foreigner had used a radio to call colleagues for help immediately after the shooting - and that a second consular car turned up to rescue him.
It is believed the third person killed was run over by the vehicle as it sped to his aid.
The foreigner had tried to flee the scene, but two traffic wardens chased and detained him nearby before handing him over to police, chief traffic officer Ahmad Mobeen told Dawn.
One of the shot motorcyclists has been identified in the Pakistani media as Faizan Haider, who was thought to be in his early 20s.
His older brother reportedly said the dead man had only ever carried a pistol for personal protection, and that the firearm was licensed.
"My brother was innocent, he was not a criminal. We need justice," he was quoted by AFP news agency as saying.
A headline in The Nation, a right-wing newspaper that often publishes anti-American commentary, said, "'American Rambo' goes berserk in Lahore". It described Mr David as an undercover US spy.
Our correspondent says the incident could inflame anti-American sentiment in the country.
Many Pakistanis resent the US because of regular air strikes carried out by its drone aircraft in north-west Pakistan, and because of America's role in neighbouring Afghanistan.
State department spokesman Philip Crowley told journalists in Washington: "We want to make sure that a tragedy like this does not affect the strategic partnership that we're building with Pakistan."
"And we'll work as hard as we can to explain that to the Pakistani people."
But Punjab Law Minister Rana Sanaullah said the US would not be allowed to sway Pakistani authorities' handling of the incident.
"We have also asked the US consulate to hand over the other vehicle and driver who crushed to death a motorcyclist passing by," he told the BBC Urdu service.
"We intend to deal with the culprits under Pakistani law, and no external or internal pressure will be tolerated." He added that the pistol recovered from Mr Davis was illegal, carrying separate charges.