About 9 a.m. Thursday, Maj. Nidal M. Hasan walked over to see a neighbor in his aging apartment building here on the edge of downtown. He had come to say goodbye.

The two occasionally would sit together in plastic chairs beneath a wind chime on the landing outside her second-floor apartment, she recalled. She was Christian and he was Muslim, but they shared coffee and talked about God. But this morning, Hasan said that he would be deploying to Afghanistan soon and that he did not want to go. He gave her a copy of the Koran.

“I’m going to do good work for God,” he told her.