Evidence, for instance, showed that for all his skill as a leader — he was a favorite of his senior officers — General Sinclair had a tendency to make inappropriate comments about women and to make advances toward them. He sought explicit pictures from female subordinates, and asked a young lieutenant, a former college athlete half his age, on a horseback-riding date.

The atmosphere in his unit was such that at a farewell party when he left brigade command four years ago, soldiers in his unit put on a skit in which one, dressed in a wig and clothes in an apparent portrayal of the captain, acted out a scene in which that person asked another soldier, seated in a chair and portraying then-Colonel Sinclair, whether he wanted oral sex.

But as the case evolved, evidence also suggested that the most serious charges against him — that he had forced the captain to perform oral sex on him twice and threatened her and her family if she revealed their affair — were far from clear-cut.

At a hearing in late 2012 known as an Article 32, roughly akin to a preliminary hearing in civilian criminal courts, it became clear that the captain had been sleeping with him regularly. By her own testimony, his threat to kill her and her family came immediately after they finished having sex, when she had told him that she was looking forward to meeting his wife.

The captain also testified that when she confided the affair to a friend, she told him that the general never raped her. “It was consensual,” she said. She also acknowledged writing a journal entry about the general in which she stated that “my biggest fear is that there is something still in his marriage.”

In January, forensic analysis indicated she had testified untruthfully at a hearing about finding an old iPhone that contained evidence of the affair. That alarmed the chief prosecutor, Lt. Col. William Helixon, so much that he began pushing his superiors to dismiss the sexual assault charges, which were based solely on her accusations, because he no longer believed he could win a conviction. He quit the case after they did not.

As the court-martial began at Fort Bragg this month, Army officials, responding to reports about Colonel Helixon’s resignation, sought to portray his misgivings about the captain as being influenced by other stresses in his life, even describing him at one point as being suicidal. People who know Colonel Helixon called the assertion ridiculous.

Two weeks ago, after the trial had begun, the prosecution belatedly turned over emails to the defense showing that, in fact, Colonel Helixon was not the only military lawyer concerned about the captain’s credibility. The messages showed that after the January hearing, Colonel Helixon’s boss had immediately alerted the commander overseeing the case, Lt. Gen. Joseph Anderson, that the woman might have testified untruthfully. But Colonel Helixon appeared to be the only official who took serious steps to modify the charges against General Sinclair.