Ms. Raphel is among a generation of diplomats who rose through the ranks of the State Department at a time when Pakistan was among America’s closest allies and a reliable bulwark against the Soviet Union. After retiring from the government in 2005, she lobbied on behalf of the Pakistani government before accepting a contract to work as a State Department adviser.

Image Robin L. Raphel in 1997. She has lost her security clearance and State Department access, officials say. Credit... Rafiqur Rahman/Reuters

While the F.B.I. secretly watched Ms. Raphel in recent months, agents suspected that she was improperly taking classified information home from the State Department, the officials said. Armed with a warrant, the agents searched her home in a prosperous neighborhood near the Maryland border with Washington, and found classified information, the officials said.

Andrew Rice, a spokesman for Ms. Raphel, said: “Nothing has changed for Ambassador Raphel. She has not been told she is the target of an investigation, and she has not been questioned.”

In a sign of the seriousness of the case, Ms. Raphel has hired Amy Jeffress, a lawyer who until recently was one of the Justice Department’s top national security prosecutors. Ms. Jeffress served as a counselor to Attorney General Eric H. Holder Jr. on security matters, as the Justice Department’s attaché to London, and as chief of national security at the United States Attorney’s Office in Washington. She joined the law firm Arnold & Porter this year. Ms. Jeffress declined to comment.

Taking home classified information is a crime, but charges are rare. The Justice Department declined to prosecute Attorney General Alberto R. Gonzales in 2008 for keeping information about the National Security Agency’s wiretapping program at his house. John M. Deutch, the C.I.A. director from May 1995 to December 1996, lost his security clearances but was not charged for keeping government secrets on his home computer. Samuel R. Berger, a former national security adviser, pleaded guilty in 2005 to a misdemeanor and paid a $50,000 fine for removing classified documents from the National Archives.

While the United States and Pakistan remain allies in the war on terrorism, tensions between the two countries have been frequently strained. American officials suspect Pakistan of supporting the Taliban and believe Pakistan has dispatched several double agents to collect intelligence from the United States government. Pakistani officials bristle at the C.I.A.’s use of drones and operatives inside the country.

This animosity has spawned a new generation of American Foreign Service officers who view Pakistan with suspicion, making Ms. Raphel and her generally sympathetic view of Pakistan out of step within the State Department.