A former military commander who served in Afghanistan will not face any jail time after his court-martial for alleged sex abuse. Brig. Gen. Jeffrey Sinclair carried on an affair with a captain and also had inappropriate relationships with two others.

His lawyer said Thursday that he will have to pay a $20,000 fine, reports CNN. The sentence came days after he agreed to plead guilty to adultery and mistreating one of the accusers. He had previously been charged with sodomy and sexual assault, but the charges were dropped as part of the deal.

According to The Associated Press, Sinclair is likely the highest-ranking military officer to face court-martial on sexual assault charges. He was the deputy commander of the 82nd Airborne Division.

The terms in the previously sealed agreement between his lawyers and military attorneys showed that it was agreed that Sinclair should serve no longer than 18 months in jail. Prosecutors also argued that he should lose military benefits during their closing arguments. However, his lawyers said that would hurt his wife and children the most.

After the hearing in Fort Bragg, North Carolina, Sinclair hugged his lawyers and told reporters that “the system worked.” He added, “All I want to do now is go up north and hug my kids and see my wife.”