An Army general being court-martialed for alleged sex crimes pleaded guilty to adultery and several other charges Thursday but will continue to fight accusations that he sexually assaulted a female captain, his attorney said.

Brig. Gen. Jeffrey A. Sinclair, a paratrooper and former deputy commander with the 82nd Airborne Division, admitted a long affair with the captain and “inappropriate relationships” with two other women. Sinclair also pleaded guilty to possessing pornography and some other minor offenses under military law.

The guilty pleas are an attempt by Sinclair to focus his trial — only the third court-martial of an Army general in half a century — on the sexual-assault charges. Those charges are more serious and carry the potential for a long prison sentence, but his defense team has argued that the evidence on those counts is flimsy.

Sinclair’s attorneys had acknowledged outside of court long ago that he had committed adultery and other nonviolent offenses. They worried that exposing a jury to days of sordid testimony about his porn and relationships with other women could inflame sentiments against him and influence the more consequential ­sexual-assault verdict.

“The prosecution team no longer gets to distract us with salacious details about acts that aren’t even criminal in the civilian world,” Sinclair’s lawyer, Richard Scheff, said in a statement. “All they’re left with is a crime that never happened.”

Opening arguments are set for Friday at Fort Bragg, N.C. Sinclair’s fate will be decided by a jury of five Army major generals.

On Wednesday, the judge in charge of the case, Col. James L. Pohl, heard arguments from both sides on how much of the pornography from Sinclair’s computers should be shown to the jury.

Prosecutors wanted to highlight the extensive porn stash that they said Sinclair kept while serving in Afghanistan; his defense team tried to limit the exposure. By pleading guilty, Sinclair will effectively prevent the jury from seeing the videos and images.

Army investigators opened their case against Sinclair in March 2012 after a female captain who served on his staff in Afghanistan and Iraq reported their three-year affair. The woman also said he had forced her to perform oral sex and once threatened to kill her and her family if she told anyone about the relationship.

Sinclair has denied those charges, and his attorneys have attacked the woman’s credibility. She has been given immunity by the prosecution and is expected to be the most important trial witness.

The court-martial comes at a sensitive time for the military. The Senate is expected to vote this week on a bill that would strip commanders of their power under military law to oversee the prosecution of sexual-assault cases and other major crimes. Instead, that authority would be transferred to uniformed military prosecutors.

The Pentagon has lobbied against the bill, saying commanders need to retain full authority under military law to ensure order and discipline in the ranks. The Senate vote is expected to be close.