FORT BRAGG, North Carolina -- An Army general who carried on a three-year affair with a captain and had two other inappropriate relationships with subordinates was reprimanded and docked $20,000 in pay Thursday, avoiding jail time in one of the U.S. military's most closely watched courts-martial.

Sinclair smiled and hugged his two lawyers in the courtroom. Outside the building, he said "the system worked" and all he wanted to do now was "hug my wife and sons."

As part of the plea deal, Sinclair's sentence could not exceed terms in a sealed agreement between defense lawyers and military attorneys. The agreement, unsealed Thursday, called for Sinclair to serve no more than 18 months in jail, but the judge's punishment was much lighter.

In closing arguments, prosecutors argued Sinclair should be thrown out of the Army and lose his military benefits, while the defense said that would harm his innocent wife and children the most. The two sides also offered contrasting arguments about the seriousness of the misdeeds that felled the general.

"It's not just one mistake. Not just one lapse in judgment. It was repeated," said prosecutor Maj. Rebecca DiMuro. "They are not mistakes. We are not in the court of criminal mistakes. These are crimes."

The defense had called a host of character witnesses this week to laud Sinclair as a selfless leader in hopes of getting a lenient punishment.

After both sides finished, Judge Col. James Pohl adjourned the hearing until Thursday. Sinclair's sentencing comes as the military and Congress grapple with sex crimes in the ranks.

Prosecutors did not ask the judge to send Sinclair to jail, even though the maximum penalty he faced on the charges to which he pleaded guilty is more than 20 years.

The judge could have dismissed Sinclair from the Army, which would have likely wiped out his Veterans Administration health care and military retirement benefits.

The general also pleaded guilty to adultery - a crime in the military - as well as using his government-issued credit card to pay for trips to see his mistress and other conduct unbecoming an officer.

The Army's case against Sinclair started to crumble as questions arose about his primary accuser's credibility and whether military officials improperly rejected a previous plea deal because of political concerns.

A military lawyer representing Sinclair argued that his wife, Rebecca, had made a significant investment in the Army herself by holding leadership positions in organizations that helped soldiers' families. Maj. Sean Foster said Rebecca Sinclair and the couple's two sons would be hurt the most if the general lost benefits.

"These three are the only truly innocent people in this case," he said.

Sinclair broke down in tears multiple times during Wednesday's hearing.

When a letter from his wife was read aloud, Sinclair buried his head in his hands, appeared to cry and dabbed his eyes with two tissues.

In the letter, Rebecca Sinclair says she hasn't fully forgiven her husband but doesn't want the Army to punish him and his family further with a significant reduction to his pension and other benefits.

"Believe me when I tell you that the public humiliation and vilification he has endured are nothing compared to the private suffering and guilt that he lives with every day," writes Rebecca Sinclair, who hasn't attended her husband's hearings.

Jeffrey Sinclair broke down at several points as he read a statement to the judge, pausing to collect himself. He apologized to his family and the women with whom he admitted inappropriate relationships.

"I've been frustrated and angry, but I don't have to look any further than the mirror for someone to blame," he said, noting the hearing came exactly two years after the captain came forward with allegations on March 19, 2012.