Pakistani officials said President Obama's national security advisor summoned Pakistan's ambassador to the White House Monday evening to deliver a threat from the president: Release Raymond Davis, an American being held in Lahore for killing two Pakistanis, or face the consequences.

National Security Advisor Tom Donilon told Ambassador Husain Haqqani, according to two Pakistani officials involved in negotiations about Davis, that the U.S. will kick Haqqani out of the U.S., close U.S. consulates in Pakistan, and cancel an upcoming visit by Pakistan's president to Washington, if Davis, a U.S. embassy employee, is not released from custody by Friday.

The outlines of the threat were confirmed to ABC News by a senior U.S. official, who was not authorized to speak on the record. A White House spokesperson, Tommy Vietor, declined comment.

Davis, 36, is expected in court early Friday morning in Lahore to face charges of shooting two men on motorcycle on Jan. 25. Davis says he killed the men because they had been following his car and were trying to rob him. Video emerged Thursday of Davis showing his State Department credentials to Pakistani police officers and saying, "I'm a consultant."

Davis is in Pakistan on a diplomatic passport, and the U.S. has demanded his immediate release on the grounds of diplomatic immunity. The stand-off between Washington and Islamabad has brought the already tense relationship between two uneasy allies to a new low.

Raymond Davis Is 'Technical Advisor' To Consulate

The U.S. has refused to elaborate publicly on Davis' position in Pakistan except to say he is a "technical advisor" for the consulate in Lahore. But U.S. officials believe Davis's life is in danger the longer he spends time in a Lahore jail cell, the target of anti-American resentment from Pakistani citizens, some of whom have called for Davis to be executed.

"Our first fear is that the sentiment of the street in Pakistan is, 'Let's take him and hang him,'" said a current senior U.S. official.

According to the official, administration officials fear that the Pakistani government lacks control over Lahore municipal police, who have Davis in custody.

Pakistani government officials have claimed that Davis was being followed by men hired by Pakistan's intelligence agency because they suspected Davis was spying. American officials have said that Davis shot the two men in self defense, after they blocked his car with their motorcycle and brandished weapons.

In a video that aired in Pakistan yesterday, Davis could be seen and heard inside the Lahore police station moments after being taken into custody.