“She wasn’t in it for the money; this wasn’t a fee-for-task thing,” Douglas H. Wise, who was deputy director of the Defense Intelligence Agency, said of Ms. Witt. “At some point, she took an ideological left turn to become aligned with the Persians.”

By the time she did, she had spent much of her adult life in a shadowy world.

Ms. Witt, who was born in El Paso, enlisted in the Air Force and entered active duty about eight months after her 18th birthday, in 1997, just after the death of her mother. Slender, with straight brown hair, she was quickly assigned to the crew of an RC-135 spy plane — a jet packed with reconnaissance equipment.

She first deployed to the Middle East in 2002, when she was sent to Saudi Arabia. Other missions followed: to Diego Garcia, a British atoll in the Indian Ocean of immense strategic value to Western militaries, and to Greece. In 2005, she served an almost six-month deployment to Iraq at a time of growing sectarian violence and insurgent attacks. The next year, she began a roughly seven-month tour in Qatar.

In June 2008, the same month she left the Air Force, she earned a bachelor’s degree from the University of Maryland University College, and later worked for two national security contractors. Eventually, she entered graduate school at George Washington, an academic proving ground for aspiring diplomats and researchers near the State Department’s headquarters.

Members of Ms. Witt’s family, who did not respond to messages after her indictment was announced, said little about her to neighbors. According to Mr. Ellis, her classmate, she seemed to have drifted from her relatives.

Connie Shields, who lives near Ms. Witt’s father, Harry Witt, in Longwood, Fla., said there had been little discussion of Ms. Witt’s intelligence work. “It just was not talked about,” Ms. Shields said. “I don’t think Harry knew too much about where she was or what she was doing.”

She was only somewhat less mysterious at George Washington. To classmates, many of whom were far younger than her, she appeared shaken by her time in Iraq, withdrawn, even alienated.