A former helicopter squadron commander has pleaded guilty to assaulting a fellow officer and will spend a year behind bars, officials confirmed this week.

Before his plea deal, Cmdr. John M. Neuhart faced charges of attempted rape and sexual assault, plus specifications involving him secretly recording a female lieutenant’s residence and fleeing from San Diego police when they arrived there, according to charge sheets.

He’s been dogged by misconduct allegations since a boozy Sept. 12, 2016 night out in San Diego with the unnamed subordinate.

After she accused him of attempted rape, superiors removed Neuhart as the commanding officer of Helicopter Sea Combat Squadron 25.

His case percolated through several San Diego courtrooms over the next two years.

Two civilian trials ended with hung juries before a judge dismissed charges against him in June 2018.

The Navy filed court-martial charges against him eight months later.

Neuhart pleaded guilty on Aug. 26 to two counts of assault consummated by battery on a commissioned officer for unlawfully grabbing the woman’s body and arms, according to charge sheets and Navy Region Southwest spokesman Brian O’Rourke.

Neuhart also pleaded guilty to conduct unbecoming an officer for engaging in sexual activity with the female officer in the back seat of a “passenger vehicle” before accompanying “the intoxicated junior officer into her home with the intent to engage in sexual activity,” according to O’Rourke and the charge sheets.

Michael Hanzel — Neuhart’s criminal defense attorney — said Tuesday that his client is a married father of six and a good man who made bad choices.

“This case stems from poor decisions he made, while drunk, on one night three years ago,” Hanzel said in an email to Navy Times. “He took accountability for his actions because it was the right thing to do, and he respects the Court’s decision in his case.”

Neuhart “has made many positive changes” in his life due to the “shame and sorrow he has struggled with since that night,” Hanzel added.

In addition to spending a year in San Diego’s Naval Consolidated Brig Miramar, Neuhart received a letter of reprimand and will forfeit $1,000 a month for six months, according to O’Rourke.

But O’Rourke said the money won’t be taken from him if he ensures his family continues to receive financial allotments from his pay.

In the previous cases tried in civilian courtrooms, prosecutors accused Neuhart of trying to rape the lieutenant after they returned to her San Diego residence after a night of heavy drinking.

During the second trial, the junior officer testified that Neuhart attacked her after forcing his way into her home and only stopped when her screams alerted a neighbor.

Neuhart fled from the back of her residence and was arrested by police after he fell and broke his leg.

He recorded part of the encounter on his phone, and a woman can be heard shouting, “No! Stop!”

Before they deadlocked in his second trial, the jury heard a recording of her screaming roughly 90 times for him to quit trying to have sex with her and leave.

Both sides acknowledged the woman was inebriated. Video surveillance footage also showed her hugging and kissing Neuhart before they got into a limousine bound for her residence.

At an earlier trial, Neuhart said the woman consented to going home and having sex with him. He said he recorded a portion of the encounter in case she later accused him of rape.

A naval aviator, Neuhart enlisted in the service in 1995 and received his commission in 2000, according to service records.