ISLAMABAD, Pakistan  An American official shot and killed two men on a motorcycle who apparently threatened to rob him at gunpoint while he was driving his car in the city of Lahore on Thursday, according to senior police officials there.

The official, Raymond Davis, who was posted to the United States Consulate in Lahore, called the consulate for help during the episode, and a four-wheel-drive vehicle that tried to come to his rescue hit and killed a third man, said the senior superintendent of police, Faisal Rana.

Later, Lahore police officials filed murder charges against Mr. Davis on Thursday night in the deaths of the two men on the motorcycle. The police indicated that they were no longer convinced that there had been an attempted robbery.

The deaths of three Pakistanis in a case involving an armed American official at midday in a busy metropolitan area could heighten anti-American sentiment, which already runs high in Pakistan. Many here distrust and disapprove of the United States’ support of the fight against Taliban militants in the country.